def save_reconstruction_no_point(self, reconstruction, minify=False): with io.open_wt( self._reconstruction_file( 'reconstruction_no_point.json')) as fout: objs = io.reconstructions_to_json(reconstruction) for obj in objs: obj['points'] = {} io.json_dump(objs, fout, minify)
def save_undistorted_reconstruction( self, reconstruction: List[types.Reconstruction]) -> None: filename = os.path.join(self.data_path, "reconstruction.json") io.mkdir_p(self.data_path) with io.open_wt(filename) as fout: io.json_dump(io.reconstructions_to_json(reconstruction), fout, minify=True)
def save_reconstruction( self, reconstruction: List[types.Reconstruction], filename: Optional[str] = None, minify=False, ) -> None: with self.io_handler.open_wt(self._reconstruction_file(filename)) as fout: io.json_dump(io.reconstructions_to_json(reconstruction), fout, minify)
def test_panoshots_consistency() -> None: rec_before = types.Reconstruction() camera1 = pygeometry.Camera.create_spherical() camera1.id = "camera1" rec_before.add_camera(camera1) rec_before.create_shot("shot1", "camera1") rec_before.create_shot("shot2", "camera1") rec_before.create_pano_shot("shot1", "camera1") rec_before.create_pano_shot("shot2", "camera1") rec_before.create_pano_shot("shot4", "camera1") rec_before.create_pano_shot("shot3", "camera1") json_data = io.reconstructions_to_json([rec_before]) rec_after = io.reconstructions_from_json(json_data)[0] utils.assert_reconstructions_equal(rec_before, rec_after)
def save_reconstruction(self, reconstruction, filename=None, minify=False): with open(self.__reconstruction_file(filename), 'w') as fout: io.json_dump(io.reconstructions_to_json(reconstruction), fout, minify)
def save_reconstructions(reconstructions): with io.open_wt('reconstruction_aligned.json') as fout: io.json_dump(io.reconstructions_to_json(reconstructions), fout, False)
def save_reconstruction(self, reconstruction, filename=None, minify=False): with io.open_wt(self._reconstruction_file(filename)) as fout: io.json_dump(io.reconstructions_to_json(reconstruction), fout, minify)
def save_reconstruction(self, reconstruction, filename=None, indent=4): with open(self.__reconstruction_file(filename), 'w') as fout: io.json_dump(io.reconstructions_to_json(reconstruction), fout)
def save_reconstruction(file_path,reconstruction, filename=None, minify=False): with io.open_wt(_reconstruction_file(file_path,filename)) as fout: io.json_dump(io.reconstructions_to_json(reconstruction), fout, minify)
def save_reconstruction(self, reconstruction, filename=None, indent=4): with open(self.__reconstruction_file(filename), 'w') as fout: io.json_dump(io.reconstructions_to_json(reconstruction), fout)