(self, dpt, cube, com, off, joints3D, M, pad_value=0)
return new_dpt, new_joints3D, new_com, Mnew
Adjust already cropped image such that a moving CoM normalization is simulated
        :param dpt: cropped depth image with different CoM
        :param cube: metric cube of size (sx,sy,sz)
        :param com: original center of mass, in image coordinates (x,y,z)
        :param off: offset to center of mass (dx,dy,dz) in 3D coordinates
        :param joints3D: 3D joint coordinates, cropped to old CoM
        :param pad_value: value of padding
        :return: adjusted image, new 3D joint coordinates, new center of mass in image coordinates
Adjust already cropped image such that a moving CoM normalization is simulated
        :param dpt: cropped depth image with different CoM
        :param cube: metric cube of size (sx,sy,sz)
        :param com: original center of mass, in image coordinates (x,y,z)
        :param off: offset to center of mass (dx,dy,dz) in 3D coordinates
        :param joints3D: 3D joint coordinates, cropped to old CoM
        :param pad_value: value of padding
        :return: adjusted image, new 3D joint coordinates, new center of mass in image coordinates
Adjust already cropped image such that a moving CoM normalization is simulated : param dpt : cropped depth image with different CoM : param cube : metric cube of size ( sx sy sz ) : param com : original center of mass in image coordinates ( x y z ) : param off : offset to center of mass ( dx dy dz ) in 3D coordinates : param joints3D : 3D joint coordinates cropped to old CoM : param pad_value : value of padding : return : adjusted image new 3D joint coordinates new center of mass in image coordinates
def moveCoM(self, dpt, cube, com, off, joints3D, M, pad_value=0):
        """
        Adjust already cropped image such that a moving CoM normalization is simulated
        :param dpt: cropped depth image with different CoM
        :param cube: metric cube of size (sx,sy,sz)
        :param com: original center of mass, in image coordinates (x,y,z)
        :param off: offset to center of mass (dx,dy,dz) in 3D coordinates
        :param joints3D: 3D joint coordinates, cropped to old CoM
        :param pad_value: value of padding
        :return: adjusted image, new 3D joint coordinates, new center of mass in image coordinates
        """

        # if offset is 0, nothing to do
        if numpy.allclose(off, 0.):
            return dpt, joints3D, com, M

        # add offset to com
        new_com = self.importer.joint3DToImg(self.importer.jointImgTo3D(com) + off)

        # check for 1/0.
        if not (numpy.allclose(com[2], 0.) or numpy.allclose(new_com[2], 0.)):
            # scale to original size
            Mnew = self.comToTransform(new_com, cube, dpt.shape)
            new_dpt = self.recropHand(dpt, Mnew, numpy.linalg.inv(M), dpt.shape, background_value=pad_value,
                                      nv_val=32000., thresh_z=True, com=new_com, size=cube)
        else:
            Mnew = M
            new_dpt = dpt

        # adjust joint positions to new CoM
        new_joints3D = joints3D + self.importer.jointImgTo3D(com) - self.importer.jointImgTo3D(new_com)

        return new_dpt, new_joints3D, new_com, Mnew
def moveCoM ( self , dpt , cube , com , off , joints3D , M , pad_value = 0 ) : # if offset is 0, nothing to do if numpy . allclose ( off , 0. ) : return dpt , joints3D , com , M # add offset to com new_com = self . importer . joint3DToImg ( self . importer . jointImgTo3D ( com ) + off ) # check for 1/0. if not ( numpy . allclose ( com [ 2 ] , 0. ) or numpy . allclose ( new_com [ 2 ] , 0. ) ) : # scale to original size Mnew = self . comToTransform ( new_com , cube , dpt . shape ) new_dpt = self . recropHand ( dpt , Mnew , numpy . linalg . inv ( M ) , dpt . shape , background_value = pad_value , nv_val = 32000. , thresh_z = True , com = new_com , size = cube ) else : Mnew = M new_dpt = dpt # adjust joint positions to new CoM new_joints3D = joints3D + self . importer . jointImgTo3D ( com ) - self . importer . jointImgTo3D ( new_com ) return new_dpt , new_joints3D , new_com , Mnew