def Execute(self): bundleFile = self.GetInputStageValue(0, "bundleFile") images = self.GetInputStageValue(0, "images") pmvsPath = self._properties["Target Path"] self.StartProcess() paths = self.Bundle2PMVS(images.GetImageListPath(), bundleFile.GetBundleFilePath(), pmvsPath) visFile = self.Bundle2Vis(pmvsPath, bundleFile.GetBundleFilePath()) images = self.CopyImagesToVisualizeDirectory(images, paths[1]) bundleFileDest = self.CopyBundleFile(bundleFile.GetBundleFilePath(), pmvsPath) bundleFile = BundleAdjustment.BundleFile(bundleFileDest, images.GetImages()) visFile = Cluster.VisFile(visFile) # TODO: linux hack if (not Common.Utility.IsWindows() or Common.Utility.PlatformName=="Windows64bit"): Common.Utility.CopyFiles(pmvsPath, paths[0], "txt") os.remove(os.path.join(paths[0], "pmvs_options.txt")) cameraMatrices = Cluster.CameraMatrices(paths[0]) self.SetOutputValue("bundleFile", bundleFile) self.SetOutputValue("images", images) self.SetOutputValue("visFile", visFile) self.SetOutputValue("cameraMatrices", cameraMatrices)
def Execute(self): bundleFile = self.GetInputStageValue(0, "bundleFile") images = self.GetInputStageValue(0, "images") self.StartProcess() pmvsPath = os.path.split(bundleFile.GetBundleFilePath())[0] numImages = len(images.GetImages()) visFile = os.path.join(pmvsPath, "vis.dat") clusterFile = os.path.join(pmvsPath, "ske.dat") cameraCentersAll = os.path.join(pmvsPath, "centers-all.ply") if (Common.Utility.ShouldRun(self._properties["Force Run"], visFile, clusterFile, cameraCentersAll)): self.Process(pmvsPath, numImages) self.SetOutputValue("bundleFile", bundleFile) self.SetOutputValue("images", images) self.SetOutputValue("visFile", Cluster.VisFile(visFile)) self.SetOutputValue("clusterFile", Cluster.ClusterFile(clusterFile)) self.SetOutputValue("cameraCentersAll", Cluster.PlyFile(cameraCentersAll))