(self, frame)
Show the depth image
        :param frame: image to show
        :return:
Show the depth image
        :param frame: image to show
        :return:
Show the depth image : param frame : image to show : return :
def showAnnotatedDepth(self, frame):
        """
        Show the depth image
        :param frame: image to show
        :return:
        """
        import matplotlib
        import matplotlib.pyplot as plt

        print("img min {}, max {}".format(frame.dpt.min(),frame.dpt.max()))
        fig = plt.figure()
        ax = fig.add_subplot(111)
        ax.imshow(frame.dpt, cmap=matplotlib.cm.jet, interpolation='nearest')
        ax.scatter(frame.gtcrop[:, 0], frame.gtcrop[:, 1])

        ax.plot(frame.gtcrop[0:5, 0], frame.gtcrop[0:5, 1], c='r')
        ax.plot(np.hstack((frame.gtcrop[0, 0], frame.gtcrop[5:9, 0])), np.hstack((frame.gtcrop[0, 1], frame.gtcrop[5:9, 1])), c='r')
        ax.plot(np.hstack((frame.gtcrop[0, 0], frame.gtcrop[9:13, 0])), np.hstack((frame.gtcrop[0, 1], frame.gtcrop[9:13, 1])), c='r')
        ax.plot(np.hstack((frame.gtcrop[0, 0], frame.gtcrop[13:17, 0])), np.hstack((frame.gtcrop[0, 1], frame.gtcrop[13:17, 1])), c='r')
        ax.plot(np.hstack((frame.gtcrop[0, 0], frame.gtcrop[17:21, 0])), np.hstack((frame.gtcrop[0, 1], frame.gtcrop[17:21, 1])), c='r')

        def format_coord(x, y):
            numrows, numcols = frame.dpt.shape
            col = int(x+0.5)
            row = int(y+0.5)
            if col>=0 and col<numcols and row>=0 and row<numrows:
                z = frame.dpt[row, col]
                return 'x=%1.4f, y=%1.4f, z=%1.4f'%(x, y, z)
            else:
                return 'x=%1.4f, y=%1.4f'%(x, y)
        ax.format_coord = format_coord

        for i in range(frame.gtcrop.shape[0]):
            ax.annotate(str(i), (int(frame.gtcrop[i, 0]), int(frame.gtcrop[i, 1])))

        plt.show()
def showAnnotatedDepth ( self , frame ) : import matplotlib import matplotlib . pyplot as plt print ( "img min {}, max {}" . format ( frame . dpt . min ( ) , frame . dpt . max ( ) ) ) fig = plt . figure ( ) ax = fig . add_subplot ( 111 ) ax . imshow ( frame . dpt , cmap = matplotlib . cm . jet , interpolation = 'nearest' ) ax . scatter ( frame . gtcrop [ : , 0 ] , frame . gtcrop [ : , 1 ] ) ax . plot ( frame . gtcrop [ 0 : 5 , 0 ] , frame . gtcrop [ 0 : 5 , 1 ] , c = 'r' ) ax . plot ( np . hstack ( ( frame . gtcrop [ 0 , 0 ] , frame . gtcrop [ 5 : 9 , 0 ] ) ) , np . hstack ( ( frame . gtcrop [ 0 , 1 ] , frame . gtcrop [ 5 : 9 , 1 ] ) ) , c = 'r' ) ax . plot ( np . hstack ( ( frame . gtcrop [ 0 , 0 ] , frame . gtcrop [ 9 : 13 , 0 ] ) ) , np . hstack ( ( frame . gtcrop [ 0 , 1 ] , frame . gtcrop [ 9 : 13 , 1 ] ) ) , c = 'r' ) ax . plot ( np . hstack ( ( frame . gtcrop [ 0 , 0 ] , frame . gtcrop [ 13 : 17 , 0 ] ) ) , np . hstack ( ( frame . gtcrop [ 0 , 1 ] , frame . gtcrop [ 13 : 17 , 1 ] ) ) , c = 'r' ) ax . plot ( np . hstack ( ( frame . gtcrop [ 0 , 0 ] , frame . gtcrop [ 17 : 21 , 0 ] ) ) , np . hstack ( ( frame . gtcrop [ 0 , 1 ] , frame . gtcrop [ 17 : 21 , 1 ] ) ) , c = 'r' ) def format_coord ( x , y ) : numrows , numcols = frame . dpt . shape col = int ( x + 0.5 ) row = int ( y + 0.5 ) if col >= 0 and col < numcols and row >= 0 and row < numrows : z = frame . dpt [ row , col ] return 'x=%1.4f, y=%1.4f, z=%1.4f' % ( x , y , z ) else : return 'x=%1.4f, y=%1.4f' % ( x , y ) ax . format_coord = format_coord for i in range ( frame . gtcrop . shape [ 0 ] ) : ax . annotate ( str ( i ) , ( int ( frame . gtcrop [ i , 0 ] ) , int ( frame . gtcrop [ i , 1 ] ) ) ) plt . show ( )