def compute_farthest_surface_point_3d_num(num): for cls in cfg.linemod_cls_names: pts = np.loadtxt(os.path.join(cfg.LINEMOD, cls, 'dense_pts.txt'))[:, :3] spts = farthest_point_sampling(pts, num, True) write_points( os.path.join(cfg.LINEMOD, cls, 'farthest{}.txt'.format(num)), spts)
def compute_farthest_surface_point_3d(): for cls in cfg.homemade_cls_names: pts = np.loadtxt(os.path.join(cfg.HOMEMADE, cls, 'dense_pts.txt'))[:, :3] spts = farthest_point_sampling(pts, 8, True) write_points( os.path.join(cfg.HOMEMADE, cls, 'farthest.txt'.format(cls)), spts)
def compute_farthest_surface_point_3d(): for cls in cfg.linemod_cls_names: #only px py pz 3-dims , no need nx ny nz rgb pts = np.loadtxt(os.path.join(cfg.LINEMOD, cls, 'dense_pts.txt'))[:, :3] spts = farthest_point_sampling(pts, 8, True) write_points( os.path.join(cfg.LINEMOD, cls, 'farthest.txt'.format(cls)), spts)
def get_farthest_3d(self,class_type,num=8): if class_type in self.farthest_3d['{}'.format(num)]: return self.farthest_3d['{}'.format(num)][class_type] if num==8: farthest_path = self.farthest_pattern.format(class_type,'') else: farthest_path = self.farthest_pattern.format(class_type,num) if os.path.exists(farthest_path): farthest_pts = np.loadtxt(farthest_path) else: pts_path = os.path.join(cfg.LINEMOD, '{}/dense_pts.txt'.format(class_type)) pts = np.loadtxt(pts_path) farthest_pts = farthest_point_sampling(pts, num) np.savetxt(farthest_path, farthest_pts) self.farthest_3d['{}'.format(num)][class_type] = farthest_pts return farthest_pts