curve.py 文件源码

python
阅读 37 收藏 0 点赞 0 评论 0

项目:lddmm-ot 作者: jeanfeydy 项目源码 文件源码
def to_measure(self) :
        """
        Outputs the sum-of-diracs measure associated to the curve.
        Each segment from the connectivity matrix self.c
        is represented as a weighted dirac located at its center,
        with weight equal to the segment length.
        """
        segments = self.segments()
        centers = [         .5 * (  seg[0] + seg[1]      ) for seg in segments ]
        lengths = [np.sqrt(np.sum( (seg[1] - seg[0])**2 )) for seg in segments ]
        return ( np.array(centers), np.array(lengths) )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号