示例#1
0
    def set_poses(self, R, t):
        self.F = R.shape[0]
        self.Rs = R.astype(np.float32)
        self.ts = t.astype(np.float32)
        self.Cs = Geom.global_to_local(R, t)[1].astype(np.float32)

        if len(self.frame_range) == 0:
            self.frame_range = zeros((self.F, 2), np.uint32)
示例#2
0
 def apply_bounding_boxes(self, frames, bboxes):
     tw = Geom.global_to_local(self.Rs, self.ts)[1]
     center = tw.mean(axis=0)
     size = 5.0 * np.abs(tw - center).max(axis=0)
     # center = np.r_[0.0, 0.0, 1.0]
     # size = np.r_[1.0, 1.0, 1.0]
     bbox_min, bbox_max = Geom.frustrum_bounding_box(self.Rs,
                                                     self.ts,
                                                     self.cam,
                                                     frames,
                                                     bboxes,
                                                     center=center,
                                                     size=size,
                                                     res=100)
     print("BBOX:", bbox_min, bbox_max)
     self.bbox_min = bbox_min
     self.bbox_max = bbox_max