예제 #1
0
    def test_equal_rigs(self):

        kapture_data_a = copy.deepcopy(self._kapture_data)
        kapture_data_b = copy.deepcopy(self._kapture_data)
        self.assertTrue(equal_rigs(kapture_data_a.rigs, kapture_data_b.rigs))

        kapture_data_a.rigs['497376'] = self._rigs['rig_a']
        self.assertFalse(equal_rigs(kapture_data_a.rigs, kapture_data_b.rigs))

        kapture_data_b.rigs['497376'] = self._rigs['rig_a']
        self.assertTrue(equal_rigs(kapture_data_a.rigs, kapture_data_b.rigs))

        kapture_data_b.rigs['497376'] = self._rigs['rig_b']
        self.assertFalse(equal_rigs(kapture_data_a.rigs, kapture_data_b.rigs))
예제 #2
0
 def test_rig_recover_inplace(self):
     trajectories = deepcopy(self._trajectories_cams)
     rigs = deepcopy(self._rigs)
     kapture.rigs_recover_inplace(trajectories, rigs)
     self.assertTrue(
         equal_trajectories(trajectories, self._trajectories_rigs))
     self.assertTrue(equal_rigs(rigs, self._rigs))
예제 #3
0
 def test_rig_remove_inplace_consistency(self):
     # compare inplace and not inplace
     trajectories_inplace = deepcopy(self._trajectories_rigs)
     rigs_inplace = deepcopy(self._rigs)
     kapture.rigs_remove_inplace(trajectories_inplace, rigs_inplace)
     trajectories_not_inplace = kapture.rigs_remove(self._trajectories_rigs, self._rigs)
     self.assertTrue(equal_trajectories(trajectories_inplace, trajectories_not_inplace))
     # make sure rigs are untouched.
     self.assertTrue(equal_rigs(rigs_inplace, self._rigs))