models.py 文件源码

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

项目:pypcl 作者: cmpute 项目源码 文件源码
def compute_variance(self, error_sqr_dists=None):
        '''
        Compute the variance of the errors to the model.

        # Parameters
        error_sqr_dists : list of float
            A vector holding the distances

        # Returns
        variance : double
        '''
        if error_sqr_dists is None:
            if len(self._error_sqr_dists) == 0:
                raise ValueError('The variance of the Sample Consensus model distances cannot \
                be estimated, as the model has not been computed yet. Please compute the model \
                first or at least run selectWithinDistance before continuing.')
            error_sqr_dists = self._error_sqr_dists

        medidx = int(len(error_sqr_dists) / 2)
        return 2.1981 * np.partition(error_sqr_dists, medidx)[medidx]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号