mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-21 04:56:28 +02:00
tolerant bracket size selection
This commit is contained in:
parent
9d09e851b2
commit
6a0583d8e5
3 changed files with 42 additions and 15 deletions
|
@ -1,6 +1,7 @@
|
|||
__version__ = "4.0"
|
||||
|
||||
import json
|
||||
from collections import Counter
|
||||
|
||||
from meshroom.core import desc
|
||||
|
||||
|
@ -250,7 +251,7 @@ Sample pixels from Low range images for HDR creation.
|
|||
exposureGroups.append(exposures)
|
||||
|
||||
exposures = None
|
||||
bracketSizes = set()
|
||||
bracketSizes = Counter()
|
||||
if len(exposureGroups) == 1:
|
||||
if len(set(exposureGroups[0])) == 1:
|
||||
# Single exposure and multiple views
|
||||
|
@ -260,8 +261,16 @@ Sample pixels from Low range images for HDR creation.
|
|||
node.nbBrackets.value = len(exposureGroups[0])
|
||||
else:
|
||||
for expGroup in exposureGroups:
|
||||
bracketSizes.add(len(expGroup))
|
||||
if len(bracketSizes) == 1:
|
||||
node.nbBrackets.value = bracketSizes.pop()
|
||||
else:
|
||||
bracketSizes[len(expGroup)] += 1
|
||||
|
||||
if len(bracketSizes) == 0:
|
||||
node.nbBrackets.value = 0
|
||||
else:
|
||||
bestTuple = bracketSizes.most_common(1)[0]
|
||||
bestBracketSize = bestTuple[0]
|
||||
bestCount = bestTuple[1]
|
||||
total = bestBracketSize * bestCount
|
||||
if len(inputs) - total < 2:
|
||||
node.nbBrackets.value = bestBracketSize
|
||||
else:
|
||||
node.nbBrackets.value = 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue