mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-13 23:07:21 +02:00
[nodes] Split360Images: custom dynamic node size for chunkable output
This commit is contained in:
parent
eb198fbfa5
commit
db978d4dc3
2 changed files with 19 additions and 0 deletions
|
@ -31,6 +31,7 @@ class DividedInputNodeSize(desc.DynamicNodeSize):
|
||||||
def __init__(self, param, divParam):
|
def __init__(self, param, divParam):
|
||||||
super(DividedInputNodeSize, self).__init__(param)
|
super(DividedInputNodeSize, self).__init__(param)
|
||||||
self._divParam = divParam
|
self._divParam = divParam
|
||||||
|
|
||||||
def computeSize(self, node):
|
def computeSize(self, node):
|
||||||
s = super(DividedInputNodeSize, self).computeSize(node)
|
s = super(DividedInputNodeSize, self).computeSize(node)
|
||||||
divParam = node.attribute(self._divParam)
|
divParam = node.attribute(self._divParam)
|
||||||
|
|
|
@ -2,8 +2,26 @@ __version__ = "3.0"
|
||||||
|
|
||||||
from meshroom.core import desc
|
from meshroom.core import desc
|
||||||
|
|
||||||
|
|
||||||
|
class Split360InputNodeSize(desc.DynamicNodeSize):
|
||||||
|
'''
|
||||||
|
The Split360Images will increase the amount of views in the SfMData.
|
||||||
|
This class converts the number of input views into the number of split output views.
|
||||||
|
'''
|
||||||
|
def computeSize(self, node):
|
||||||
|
s = super(Split360InputNodeSize, self).computeSize(node)
|
||||||
|
factor = 0
|
||||||
|
mode = node.attribute('splitMode')
|
||||||
|
if mode.value == 'equirectangular':
|
||||||
|
factor = node.attribute('equirectangularGroup.equirectangularNbSplits').value
|
||||||
|
elif mode.value == 'dualfisheye':
|
||||||
|
factor = 2
|
||||||
|
return s * factor
|
||||||
|
|
||||||
|
|
||||||
class Split360Images(desc.AVCommandLineNode):
|
class Split360Images(desc.AVCommandLineNode):
|
||||||
commandLine = 'aliceVision_split360Images {allParams}'
|
commandLine = 'aliceVision_split360Images {allParams}'
|
||||||
|
size = Split360InputNodeSize('input')
|
||||||
|
|
||||||
category = 'Utils'
|
category = 'Utils'
|
||||||
documentation = "This node is used to extract multiple images from equirectangular or dualfisheye images."
|
documentation = "This node is used to extract multiple images from equirectangular or dualfisheye images."
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue