(self, frame, pose,dataset)
return imgcopy
Show depth with overlayed joints
        :param frame: depth frame
        :param pose: joint positions
        :return: image
Show depth with overlayed joints
        :param frame: depth frame
        :param pose: joint positions
        :return: image
Show depth with overlayed joints : param frame : depth frame : param pose : joint positions : return : image
def show2(self, frame, pose,dataset):
        """
        Show depth with overlayed joints
        :param frame: depth frame
        :param pose: joint positions
        :return: image
        """

        # plot depth image with annotations
        imgcopy = frame.copy()
        # display hack to hide nd depth
        msk = np.logical_and(32001 > imgcopy, imgcopy > 0)
        msk2 = np.logical_or(imgcopy == 0, imgcopy == 32001)
        min = imgcopy[msk].min()
        max = imgcopy[msk].max()
        imgcopy = (imgcopy - min) / (max - min) * 255.
        imgcopy[msk2] = 255.
        imgcopy = imgcopy.astype('uint8')
        imgcopy = cv2.cvtColor(imgcopy, cv2.COLOR_GRAY2BGR)
        imgcopy2 = imgcopy.copy()

        jtI = self.importer.joints3DToImg(pose)

        for i in range(jtI.shape[0]):
            cv2.circle(imgcopy, (jtI[i, 0], jtI[i, 1]), 6, (255, 255, 255), -1)

        import matplotlib
        if dataset == 'icvl':
            jointConnections = [[0, 1], [1, 2], [2, 3], [0, 4], [4, 5], [5, 6], [0, 7], [7, 8], [8, 9], [0, 10],
                                 [10, 11], [11, 12], [0, 13], [13, 14], [14, 15]]
            jointConnectionColors = [matplotlib.colors.hsv_to_rgb(np.asarray([[[0.00, 1, 0.6]]]))[0, 0], matplotlib.colors.hsv_to_rgb(np.asarray([[[0.00, 1, 0.8]]]))[0, 0], matplotlib.colors.hsv_to_rgb(np.asarray([[[0.00, 1, 1]]]))[0, 0],
                                      matplotlib.colors.hsv_to_rgb(np.asarray([[[0.33, 1, 0.6]]]))[0, 0], matplotlib.colors.hsv_to_rgb(np.asarray([[[0.33, 1, 0.8]]]))[0, 0], matplotlib.colors.hsv_to_rgb(np.asarray([[[0.33, 1, 1]]]))[0, 0],
                                      matplotlib.colors.hsv_to_rgb(np.asarray([[[0.50, 1, 0.6]]]))[0, 0], matplotlib.colors.hsv_to_rgb(np.asarray([[[0.50, 1, 0.8]]]))[0, 0], matplotlib.colors.hsv_to_rgb(np.asarray([[[0.50, 1, 1]]]))[0, 0],
                                      matplotlib.colors.hsv_to_rgb(np.asarray([[[0.66, 1, 0.6]]]))[0, 0], matplotlib.colors.hsv_to_rgb(np.asarray([[[0.66, 1, 0.8]]]))[0, 0], matplotlib.colors.hsv_to_rgb(np.asarray([[[0.66, 1, 1]]]))[0, 0],
                                      matplotlib.colors.hsv_to_rgb(np.asarray([[[0.83, 1, 0.6]]]))[0, 0], matplotlib.colors.hsv_to_rgb(np.asarray([[[0.83, 1, 0.8]]]))[0, 0], matplotlib.colors.hsv_to_rgb(np.asarray([[[0.83, 1, 1]]]))[0, 0]]

        elif dataset =='nyu':

            jointConnections = [[0, 1], [1, 13], [2, 3], [3, 13], [4, 5], [5, 13], [6, 7], [7, 13], [8, 9], [9, 10], [10, 13],
                          [13, 11], [13, 12]]
            jointConnectionColors = [matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.00, 1, 0.7]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.00, 1, 1]]]))[0, 0],

                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.33, 1, 0.7]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.33, 1, 1]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.50, 1, 0.7]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.50, 1, 1]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.66, 1, 0.7]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.66, 1, 1]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.83, 1, 0.6]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.83, 1, 0.8]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.83, 1, 1]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.16, 1, 0.7]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.16, 1, 1]]]))[0, 0]]
        elif dataset == 'msra':
            jointConnections = [[0,1],[1,2],[2,3],[3,4],
          [0,5],[5,6],[6,7],[7,8],
          [0,9],[9,10],[10,11],[11,12],
          [0,13],[13,14],[14,15],[15,16],
          [0,17],[17,18],[18,19],[19,20]]
            jointConnectionColors = [matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.00, 1, 0.4]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.00, 1, 0.6]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.00, 1, 0.8]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.00, 1, 1]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.33, 1, 0.4]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.33, 1, 0.6]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.33, 1, 0.8]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.33, 1, 1]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.50, 1, 0.4]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.50, 1, 0.6]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.50, 1, 0.8]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.50, 1, 1]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.66, 1, 0.4]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.66, 1, 0.6]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.66, 1, 0.8]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.66, 1, 1]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.83, 1, 0.4]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.83, 1, 0.6]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.83, 1, 0.8]]]))[0, 0],
                                          matplotlib.colors.hsv_to_rgb(numpy.asarray([[[0.83, 1, 1]]]))[0, 0]]
        elif dataset == 'bighand':
            jointConnections = [[0, 1], [0, 2], [0, 3], [0, 4],
                                [0, 5], [1, 6], [6, 7], [7, 8],
                                [2, 9], [9, 10], [10, 11], [3, 12],
                                [12, 13], [13, 14], [4, 15], [15, 16],
                                [16, 17], [5, 18], [18, 19], [19, 20]]
            jointConnectionColors = [matplotlib.colors.hsv_to_rgb(np.asarray([[[0.00, 1, 0.4]]]))[0, 0],
                                     matplotlib.colors.hsv_to_rgb(np.asarray([[[0.33, 1, 0.4]]]))[0, 0],
                                     matplotlib.colors.hsv_to_rgb(np.asarray([[[0.50, 1, 0.4]]]))[0, 0],
                                     matplotlib.colors.hsv_to_rgb(np.asarray([[[0.66, 1, 0.4]]]))[0, 0],
                                     matplotlib.colors.hsv_to_rgb(np.asarray([[[0.83, 1, 0.4]]]))[0, 0],

                                     matplotlib.colors.hsv_to_rgb(np.asarray([[[0.00, 1, 0.6]]]))[0, 0],
                                     matplotlib.colors.hsv_to_rgb(np.asarray([[[0.00, 1, 0.8]]]))[0, 0],
                                     matplotlib.colors.hsv_to_rgb(np.asarray([[[0.00, 1, 1]]]))[0, 0],

                                     matplotlib.colors.hsv_to_rgb(np.asarray([[[0.33, 1, 0.6]]]))[0, 0],
                                     matplotlib.colors.hsv_to_rgb(np.asarray([[[0.33, 1, 0.8]]]))[0, 0],
                                     matplotlib.colors.hsv_to_rgb(np.asarray([[[0.33, 1, 1]]]))[0, 0],

                                     matplotlib.colors.hsv_to_rgb(np.asarray([[[0.50, 1, 0.6]]]))[0, 0],
                                     matplotlib.colors.hsv_to_rgb(np.asarray([[[0.50, 1, 0.8]]]))[0, 0],
                                     matplotlib.colors.hsv_to_rgb(np.asarray([[[0.50, 1, 1]]]))[0, 0],

                                     matplotlib.colors.hsv_to_rgb(np.asarray([[[0.66, 1, 0.6]]]))[0, 0],
                                     matplotlib.colors.hsv_to_rgb(np.asarray([[[0.66, 1, 0.8]]]))[0, 0],
                                     matplotlib.colors.hsv_to_rgb(np.asarray([[[0.66, 1, 1]]]))[0, 0],

                                     matplotlib.colors.hsv_to_rgb(np.asarray([[[0.83, 1, 0.6]]]))[0, 0],
                                     matplotlib.colors.hsv_to_rgb(np.asarray([[[0.83, 1, 0.8]]]))[0, 0],
                                     matplotlib.colors.hsv_to_rgb(np.asarray([[[0.83, 1, 1]]]))[0, 0]]

        else:
            raise ValueError("Invalid number of joints")


        for i in range(len(jointConnections)):
            cv2.line(imgcopy, (jtI[jointConnections[i][0], 0], jtI[jointConnections[i][0], 1]),
                     (jtI[jointConnections[i][1], 0], jtI[jointConnections[i][1], 1]), 255.*jointConnectionColors[i], 5)

        return imgcopy
def show2 ( self , frame , pose , dataset ) : # plot depth image with annotations imgcopy = frame . copy ( ) # display hack to hide nd depth msk = np . logical_and ( 32001 > imgcopy , imgcopy > 0 ) msk2 = np . logical_or ( imgcopy == 0 , imgcopy == 32001 ) min = imgcopy [ msk ] . min ( ) max = imgcopy [ msk ] . max ( ) imgcopy = ( imgcopy - min ) / ( max - min ) * 255. imgcopy [ msk2 ] = 255. imgcopy = imgcopy . astype ( 'uint8' ) imgcopy = cv2 . cvtColor ( imgcopy , cv2 . COLOR_GRAY2BGR ) imgcopy2 = imgcopy . copy ( ) jtI = self . importer . joints3DToImg ( pose ) for i in range ( jtI . shape [ 0 ] ) : cv2 . circle ( imgcopy , ( jtI [ i , 0 ] , jtI [ i , 1 ] ) , 6 , ( 255 , 255 , 255 ) , - 1 ) import matplotlib if dataset == 'icvl' : jointConnections = [ [ 0 , 1 ] , [ 1 , 2 ] , [ 2 , 3 ] , [ 0 , 4 ] , [ 4 , 5 ] , [ 5 , 6 ] , [ 0 , 7 ] , [ 7 , 8 ] , [ 8 , 9 ] , [ 0 , 10 ] , [ 10 , 11 ] , [ 11 , 12 ] , [ 0 , 13 ] , [ 13 , 14 ] , [ 14 , 15 ] ] jointConnectionColors = [ matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.00 , 1 , 0.6 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.00 , 1 , 0.8 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.00 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.33 , 1 , 0.6 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.33 , 1 , 0.8 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.33 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.50 , 1 , 0.6 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.50 , 1 , 0.8 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.50 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.66 , 1 , 0.6 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.66 , 1 , 0.8 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.66 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.83 , 1 , 0.6 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.83 , 1 , 0.8 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.83 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] ] elif dataset == 'nyu' : jointConnections = [ [ 0 , 1 ] , [ 1 , 13 ] , [ 2 , 3 ] , [ 3 , 13 ] , [ 4 , 5 ] , [ 5 , 13 ] , [ 6 , 7 ] , [ 7 , 13 ] , [ 8 , 9 ] , [ 9 , 10 ] , [ 10 , 13 ] , [ 13 , 11 ] , [ 13 , 12 ] ] jointConnectionColors = [ matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.00 , 1 , 0.7 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.00 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.33 , 1 , 0.7 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.33 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.50 , 1 , 0.7 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.50 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.66 , 1 , 0.7 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.66 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.83 , 1 , 0.6 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.83 , 1 , 0.8 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.83 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.16 , 1 , 0.7 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.16 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] ] elif dataset == 'msra' : jointConnections = [ [ 0 , 1 ] , [ 1 , 2 ] , [ 2 , 3 ] , [ 3 , 4 ] , [ 0 , 5 ] , [ 5 , 6 ] , [ 6 , 7 ] , [ 7 , 8 ] , [ 0 , 9 ] , [ 9 , 10 ] , [ 10 , 11 ] , [ 11 , 12 ] , [ 0 , 13 ] , [ 13 , 14 ] , [ 14 , 15 ] , [ 15 , 16 ] , [ 0 , 17 ] , [ 17 , 18 ] , [ 18 , 19 ] , [ 19 , 20 ] ] jointConnectionColors = [ matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.00 , 1 , 0.4 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.00 , 1 , 0.6 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.00 , 1 , 0.8 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.00 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.33 , 1 , 0.4 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.33 , 1 , 0.6 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.33 , 1 , 0.8 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.33 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.50 , 1 , 0.4 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.50 , 1 , 0.6 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.50 , 1 , 0.8 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.50 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.66 , 1 , 0.4 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.66 , 1 , 0.6 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.66 , 1 , 0.8 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.66 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.83 , 1 , 0.4 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.83 , 1 , 0.6 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.83 , 1 , 0.8 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( numpy . asarray ( [ [ [ 0.83 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] ] elif dataset == 'bighand' : jointConnections = [ [ 0 , 1 ] , [ 0 , 2 ] , [ 0 , 3 ] , [ 0 , 4 ] , [ 0 , 5 ] , [ 1 , 6 ] , [ 6 , 7 ] , [ 7 , 8 ] , [ 2 , 9 ] , [ 9 , 10 ] , [ 10 , 11 ] , [ 3 , 12 ] , [ 12 , 13 ] , [ 13 , 14 ] , [ 4 , 15 ] , [ 15 , 16 ] , [ 16 , 17 ] , [ 5 , 18 ] , [ 18 , 19 ] , [ 19 , 20 ] ] jointConnectionColors = [ matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.00 , 1 , 0.4 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.33 , 1 , 0.4 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.50 , 1 , 0.4 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.66 , 1 , 0.4 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.83 , 1 , 0.4 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.00 , 1 , 0.6 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.00 , 1 , 0.8 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.00 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.33 , 1 , 0.6 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.33 , 1 , 0.8 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.33 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.50 , 1 , 0.6 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.50 , 1 , 0.8 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.50 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.66 , 1 , 0.6 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.66 , 1 , 0.8 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.66 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.83 , 1 , 0.6 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.83 , 1 , 0.8 ] ] ] ) ) [ 0 , 0 ] , matplotlib . colors . hsv_to_rgb ( np . asarray ( [ [ [ 0.83 , 1 , 1 ] ] ] ) ) [ 0 , 0 ] ] else : raise ValueError ( "Invalid number of joints" ) for i in range ( len ( jointConnections ) ) : cv2 . line ( imgcopy , ( jtI [ jointConnections [ i ] [ 0 ] , 0 ] , jtI [ jointConnections [ i ] [ 0 ] , 1 ] ) , ( jtI [ jointConnections [ i ] [ 1 ] , 0 ] , jtI [ jointConnections [ i ] [ 1 ] , 1 ] ) , 255. * jointConnectionColors [ i ] , 5 ) return imgcopy