test_ransac.py 文件源码

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

项目:prototype 作者: chutsu 项目源码 文件源码
def test_compute_inliers(self):
        sample = self.ransac.sample(self.data)
        dist = self.ransac.compute_distance(sample, self.data)
        self.ransac.compute_inliers(dist)

    # def test_optimize(self):
    #     debug = False
    #
    #     for i in range(10):
    #         m_pred, c_pred, mask = self.ransac.optimize(self.data)
    #         if debug:
    #             print("m_true: ", self.m_true)
    #             print("m_pred: ", m_pred)
    #             print("c_true: ", self.c_true)
    #             print("c_pred: ", c_pred)
    #
    #         self.assertTrue(abs(m_pred - self.m_true) < 0.5)
    #         self.assertTrue(abs(c_pred - self.c_true) < 0.5)
    #
    #         # Plot RANSAC optimized result
    #         debug = False
    #         if debug:
    #             x = np.linspace(0.0, 10.0, num=100)
    #             y = m_pred * x + c_pred
    #             plt.scatter(self.data[0, :], self.data[1, :])
    #             plt.plot(x, y)
    #             plt.show()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号