예제 #1
0
파일: PMVS.py 프로젝트: WalterBejar/catena
    def Execute(self):
        bundleFile = self.GetInputStageValue(0, "bundleFile")
        images = self.GetInputStageValue(0, "images")

        self.StartProcess()

        numImages = len(images.GetImages())
        pmvsPath = os.path.split(bundleFile.GetBundleFilePath())[0]
        optionsFileName = "pmvs_options.txt"

        optionsFilePath = os.path.join(pmvsPath, optionsFileName)
        modelFile = os.path.join(pmvsPath, "models", optionsFileName + ".ply")
        patchFile = os.path.join(pmvsPath, "models",
                                 optionsFileName + ".patch")
        psetFile = os.path.join(pmvsPath, "models", optionsFileName + ".pset")

        if (Common.Utility.ShouldRun(self._properties["Force Run"],
                                     optionsFilePath, modelFile, patchFile,
                                     psetFile)):

            self.WriteOptionsFile(optionsFilePath, numImages)

            self.RunCommand(
                "pmvs2",
                Common.Utility.CommandArgs("\"%s/\"" % pmvsPath,
                                           optionsFileName))

        self.SetOutputValue("model", Cluster.PlyFile(modelFile))
        self.SetOutputValue("patch", Cluster.PatchFile(patchFile))
        self.SetOutputValue("pset", Cluster.PsetFile(psetFile))
예제 #2
0
파일: CMVS.py 프로젝트: WalterBejar/catena
    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))
예제 #3
0
 def __parseCameraCenterFile(self, path):
     self.__cameraCenterFile = Cluster.PlyFile(
         os.path.join(path, "centers-%04d.ply" % self.__id))