示例#1
0
 def test_thin(self):
     n = 100  # number of points in original cloud, which we will thin to n/2
     cloud = PointCloud(np.zeros((3, n)), np.zeros((3, n), np.uint8))
     thinned = cloud.thin(int(n / 2))
     self.assertEquals(thinned.num_points(), n / 2)
     self.assertTrue(thinned.colored())
     self.assertEquals(cloud.num_points(), n)
示例#2
0
 def test_append(self):
     ''' Test (imperative!) append method.'''
     cloud = PointCloud(np.zeros((3, 10)), np.zeros((3, 10), np.uint8))
     cloud.append(cloud)
     self.assertEquals(cloud.num_points(), 20)
     self.assertEquals(cloud.colors().shape, (3, 20))
示例#3
0
 def test_constructor(self):
     points = np.reshape(np.arange(18), (3, 6))
     cloud = PointCloud(points)
     self.assertEquals(cloud.num_points(), 6)
     np.testing.assert_array_equal(cloud.points(), points)
     self.assertFalse(cloud.colored())