def test_GetPointCloudPointFeatures(self): """ Should not raise exception. """ pc = test_tools.generate_tiny_test_point_cloud() cols = 0.5 * (pc[keys.point]["x"]["data"] + pc[keys.point]["y"]["data"]) flavs = 0.5 * (pc[keys.point]["x"]["data"] - pc[keys.point]["y"]["data"]) pc[keys.point]["color"] = {"type": "double", "data": cols} pc[keys.point]["flavor"] = {"type": "double", "data": flavs} x, y, z = utils.get_point(pc, 2) c, f = utils.get_features(pc, ("color", "flavor"), 2) self.assertEqual(c, 0.5 * (x + y)) self.assertEqual(f, 0.5 * (x - y))
def extract(self, sourcepc, neighborhood, targetpc, targetindex, volume): x = utils.get_features(targetpc, ['x'], targetindex) x1 = np.array(list(x))[0] return x1, x1
def extract(self, sourcepc, neighborhood, targetpc, targetindex, volume): t2a, t2c = utils.get_features(targetpc, self.requires(), targetindex) x, y, z = utils.get_point(targetpc, targetindex) return t2c - t2a - z # z
def _extract_one(self, target_point_cloud, target_index): t1a, t2c = utils.get_features(target_point_cloud, self.requires(), target_index) x, y, z = utils.get_point(target_point_cloud, target_index) return t2c - t1a - z # this should be: 2 z