Пример #1
0
    def compute_PM_rays(self, height, width):
        '''
        根据Photometric的内参,计算Photometric射线方向与位置

        :param height: Photometric图高度
        :param width: Photometric图宽度
        :return: None
        '''
        photometric = filter(lambda x: x.cam_id==self.cam_id, self.cams_init)
        photometric = list(photometric)[0]
        Ks_tensor = torch.Tensor([photometric.cam_k, ]).cuda()
        Ts_tensor = torch.Tensor([photometric.cam_rt, ]).cuda()
        rays, _ = ut.ray_sampling(Ks_tensor, Ts_tensor, [height, width])
        self.PM_rays = rays
Пример #2
0
    def compute_depth_rays(self, height, width):
        '''
        根据Photoneo的内参,计算深度射线方向与位置

        :param height: Photoneo的深度图高度
        :param width: Photoneo的深度图宽度
        :return: None
        '''
        photoneo = filter(lambda x: x.cam_id==self.photoneo_id, self.cams_init)
        photoneo = list(photoneo)[0]
        Ks_tensor = torch.Tensor([photoneo.cam_k, ]).cuda()
        Ts_tensor = torch.Tensor([photoneo.cam_rt, ]).cuda()
        rays, _ = ut.ray_sampling(Ks_tensor, Ts_tensor, [height, width])
        self.PN_depth_rays = rays