python计算点云的邻接矩阵

    xiaoxiao2023-09-30  161

    def get_adj_mat_dist_euclidean(local_cord , flag_normalized = False): #print('computing dist based adj_mat') # B N K m in_shape = local_cord.get_shape().as_list() #https://stackoverflow.com/questions/37009647/compute-pairwise-distance-in-a-batch-without-replicating-tensor-in-tensorflow # dist between points loc_matmul = tf.matmul(local_cord , local_cord, transpose_b=True) loc_norm = local_cord * local_cord # B N K m r = tf.reduce_sum(loc_norm , -1, keep_dims = True) # B N K 1 r_t = tf.transpose(r, [0,1,3,2]) # B N 1 K D = r - 2*loc_matmul + r_t D = tf.identity(D, name='adj_D')
    最新回复(0)