Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
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)
Exemplo n.º 5
0
 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)
Exemplo n.º 6
0
def save_reconstructions(reconstructions):
    with io.open_wt('reconstruction_aligned.json') as fout:
        io.json_dump(io.reconstructions_to_json(reconstructions), fout, False)
Exemplo n.º 7
0
 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)
Exemplo n.º 8
0
 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)
Exemplo n.º 9
0
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)
Exemplo n.º 10
0
 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)