diff --git a/meshroom/aliceVision/FeatureExtraction.py b/meshroom/aliceVision/FeatureExtraction.py index 4bb9c1fd8c..5f383070c9 100644 --- a/meshroom/aliceVision/FeatureExtraction.py +++ b/meshroom/aliceVision/FeatureExtraction.py @@ -4,7 +4,7 @@ from meshroom.core.utils import COLORSPACES, DESCRIBER_TYPES, VERBOSE_LEVEL from pyalicevision import parallelization as avpar -class FeatureExtraction(desc.AVCommandLineNode): +class FeatureExtraction(desc.AVCommandLineNode, desc.interface.FeatureProviderInterface): """ This node extracts distinctive groups of pixels that are, to some extent, invariant to changing camera viewpoints during image acquisition. Hence, a feature in the scene should have similar feature descriptions in all images. @@ -163,3 +163,11 @@ class FeatureExtraction(desc.AVCommandLineNode): value="{nodeCacheFolder}", ), ] + + def getFeaturesFolders(self, node) -> list: + + return [node.output.value] + + def getDescriberTypes(self, node) -> list: + + return node.describerTypes.value \ No newline at end of file diff --git a/meshroom/aliceVision/FeatureMatching.py b/meshroom/aliceVision/FeatureMatching.py index 0c8a1e53cf..b4d25a24bb 100644 --- a/meshroom/aliceVision/FeatureMatching.py +++ b/meshroom/aliceVision/FeatureMatching.py @@ -4,7 +4,9 @@ from meshroom.core.utils import DESCRIBER_TYPES, VERBOSE_LEVEL from pyalicevision import parallelization as avpar -class FeatureMatching(desc.AVCommandLineNode): +class FeatureMatching(desc.AVCommandLineNode, + desc.interface.FeatureProviderInterface, + desc.interface.MatchProviderInterface): """ This node performs the matching of all features between the candidate image pairs. @@ -208,3 +210,15 @@ class FeatureMatching(desc.AVCommandLineNode): value="{nodeCacheFolder}", ), ] + + def getFeaturesFolders(self, node) -> list: + + return [f.value for f in node.featuresFolders] + + def getDescriberTypes(self, node) -> list: + + return node.describerTypes.value + + def getMatchesFolders(self, node) -> list: + + return [node.output.value] \ No newline at end of file diff --git a/meshroom/aliceVision/SfmBootstrapping.py b/meshroom/aliceVision/SfmBootstrapping.py index 64d4286f4b..eccd324e4e 100644 --- a/meshroom/aliceVision/SfmBootstrapping.py +++ b/meshroom/aliceVision/SfmBootstrapping.py @@ -4,7 +4,9 @@ from meshroom.core.utils import VERBOSE_LEVEL -class SfMBootStrapping(desc.AVCommandLineNode): +class SfMBootStrapping(desc.AVCommandLineNode, + desc.interface.FeatureProviderInterface, + desc.interface.TrackProviderInterface): """ Initialize the incremental Structure-from-Motion reconstruction by selecting the best initial image pair. @@ -116,3 +118,20 @@ class SfMBootStrapping(desc.AVCommandLineNode): value="{nodeCacheFolder}/cameras.sfm", ) ] + + + + def getFeaturesFolders(self, node) -> list: + folders = [] + for provider in self.upstreamNodesWithInterface(node, node.tracksFilename, "FeatureProviderInterface"): + folders.extend(provider.nodeDesc.getFeaturesFolders(provider)) + return folders + + def getDescriberTypes(self, node) -> list: + describerTypes = [] + for provider in self.upstreamNodesWithInterface(node, node.tracksFilename, "FeatureProviderInterface"): + describerTypes.extend(provider.nodeDesc.getDescriberTypes(provider)) + return describerTypes + + def getTracksFile(self, node) -> str: + return node.tracksFilename.value \ No newline at end of file diff --git a/meshroom/aliceVision/SfmExpanding.py b/meshroom/aliceVision/SfmExpanding.py index 57f0371f3f..ec0cab1429 100644 --- a/meshroom/aliceVision/SfmExpanding.py +++ b/meshroom/aliceVision/SfmExpanding.py @@ -4,7 +4,9 @@ from meshroom.core.utils import VERBOSE_LEVEL -class SfMExpanding(desc.AVCommandLineNode): +class SfMExpanding(desc.AVCommandLineNode, + desc.interface.FeatureProviderInterface, + desc.interface.TrackProviderInterface): """ Expand an incremental Structure-from-Motion reconstruction by localizing additional cameras. @@ -343,3 +345,18 @@ def onUseTemporalConstraintChanged(self, node): def onUseLocalBAChanged(self, node): if node.useLocalBA.value: node.useTemporalConstraint.value = False + + def getFeaturesFolders(self, node) -> list: + folders = [] + for provider in self.upstreamNodesWithInterface(node, node.tracksFilename, "FeatureProviderInterface"): + folders.extend(provider.nodeDesc.getFeaturesFolders(provider)) + return folders + + def getDescriberTypes(self, node) -> list: + describerTypes = [] + for provider in self.upstreamNodesWithInterface(node, node.tracksFilename, "FeatureProviderInterface"): + describerTypes.extend(provider.nodeDesc.getDescriberTypes(provider)) + return describerTypes + + def getTracksFile(self, node) -> str: + return node.tracksFilename.value \ No newline at end of file diff --git a/meshroom/aliceVision/StructureFromMotion.py b/meshroom/aliceVision/StructureFromMotion.py index 283ba9c5c0..a27ee61dac 100644 --- a/meshroom/aliceVision/StructureFromMotion.py +++ b/meshroom/aliceVision/StructureFromMotion.py @@ -4,7 +4,9 @@ from meshroom.core.utils import DESCRIBER_TYPES, VERBOSE_LEVEL -class StructureFromMotion(desc.AVCommandLineNode): +class StructureFromMotion(desc.AVCommandLineNode, + desc.interface.FeatureProviderInterface, + desc.interface.MatchProviderInterface): """ This node will analyze feature matches to understand the geometric relationship behind all the 2D observations, and infer the rigid scene structure (3D points) with the pose (position and orientation) and internal calibration of all cameras. @@ -391,3 +393,11 @@ class StructureFromMotion(desc.AVCommandLineNode): value="{nodeCacheFolder}", ), ] + + def getFeaturesFolders(self, node) -> list: + + return [f.value for f in node.featuresFolders] + + def getMatchesFolders(self, node) -> list: + + return [f.value for f in node.matchesFolder] \ No newline at end of file diff --git a/meshroom/aliceVision/TracksBuilding.py b/meshroom/aliceVision/TracksBuilding.py index 6dd584f0a1..079b75c8b0 100644 --- a/meshroom/aliceVision/TracksBuilding.py +++ b/meshroom/aliceVision/TracksBuilding.py @@ -4,7 +4,9 @@ from meshroom.core.utils import DESCRIBER_TYPES, VERBOSE_LEVEL -class TracksBuilding(desc.AVCommandLineNode): +class TracksBuilding(desc.AVCommandLineNode, + desc.interface.FeatureProviderInterface, + desc.interface.TrackProviderInterface): """ This node fuses all feature matches between image pairs into tracks. Each track represents a candidate point in space, visible from multiple cameras. @@ -96,3 +98,15 @@ class TracksBuilding(desc.AVCommandLineNode): value="{nodeCacheFolder}/tracksFile.json", ), ] + + def getFeaturesFolders(self, node) -> list: + + return [f.value for f in node.featuresFolders] + + def getDescriberTypes(self, node) -> list: + + return node.describerTypes.value + + def getTracksFile(self, node) -> str: + + return node.output.value \ No newline at end of file diff --git a/src/aliceVision/numeric/numeric.hpp b/src/aliceVision/numeric/numeric.hpp index 2075980c28..8913e7a583 100644 --- a/src/aliceVision/numeric/numeric.hpp +++ b/src/aliceVision/numeric/numeric.hpp @@ -286,7 +286,7 @@ Mat3 LookAt(const Vec3& center, const Vec3& up = Vec3::UnitY()); Mat3 LookAt2(const Vec3& eyePosition3D, const Vec3& center3D = Vec3::Zero(), const Vec3& upVector3D = Vec3::UnitY()); -#define SUM_OR_DYNAMIC(x, y) (x == Eigen::Dynamic || y == Eigen::Dynamic) ? Eigen::Dynamic : (x + y) +#define SUM_OR_DYNAMIC(x, y) (x == Eigen::Dynamic || y == Eigen::Dynamic) ? Eigen::Dynamic : (int(x) + int(y)) template struct hstack_return