mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-01 15:58:36 +02:00
Split LDR images set using capture time
This commit is contained in:
parent
550f685c07
commit
741b554470
3 changed files with 66 additions and 3 deletions
|
@ -232,9 +232,15 @@ Calibrate LDR to HDR response curve from samples.
|
||||||
node.nbBrackets.value = 1
|
node.nbBrackets.value = 1
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Get timestamp
|
||||||
|
ymdhms = findMetadata(d, ["Exif:DateTimeOriginal", "DateTimeOriginal", "DateTime", "Date Time", "Create Date", "ctime"], "")
|
||||||
|
timestamp = -1
|
||||||
|
if ymdhms != "":
|
||||||
|
timestamp = LdrToHdrCalibration.getTimestamp(ymdhms)
|
||||||
|
|
||||||
exposure = LdrToHdrCalibration.getExposure((float(fnumber), float(shutterSpeed), float(iso)))
|
exposure = LdrToHdrCalibration.getExposure((float(fnumber), float(shutterSpeed), float(iso)))
|
||||||
|
|
||||||
obj = avhdr.LuminanceInfo(viewpoint.viewId.value,viewpoint.path.value, exposure)
|
obj = avhdr.LuminanceInfo(viewpoint.viewId.value,viewpoint.path.value, exposure, timestamp)
|
||||||
inputs.append(obj)
|
inputs.append(obj)
|
||||||
|
|
||||||
obj = avhdr.estimateGroups(inputs)
|
obj = avhdr.estimateGroups(inputs)
|
||||||
|
@ -252,3 +258,18 @@ Calibrate LDR to HDR response curve from samples.
|
||||||
fnumber, shutterSpeed, iso = exp
|
fnumber, shutterSpeed, iso = exp
|
||||||
obj = avsfmdata.ExposureSetting(shutterSpeed, fnumber, iso)
|
obj = avsfmdata.ExposureSetting(shutterSpeed, fnumber, iso)
|
||||||
return obj.getExposure()
|
return obj.getExposure()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def getTimestamp(ymdhms):
|
||||||
|
import re
|
||||||
|
timecode = -1
|
||||||
|
if re.search("([\d]+):([\d]+):([\d]+) ([\d]+):([\d]+):([\d]+)", ymdhms) != None:
|
||||||
|
t = re.findall("([\d]+)(:| |)", ymdhms)
|
||||||
|
years = int(t[0][0])
|
||||||
|
months = int(t[1][0])
|
||||||
|
days = int(t[2][0])
|
||||||
|
hours = int(t[3][0])
|
||||||
|
minutes = int(t[4][0])
|
||||||
|
seconds = int(t[5][0])
|
||||||
|
timecode = ((((((((years * 12) + months) * 31) + days) * 24) + hours) * 60) + minutes) * 60 + seconds
|
||||||
|
return timecode
|
||||||
|
|
|
@ -305,9 +305,15 @@ Merge LDR images into HDR images.
|
||||||
node.nbBrackets.value = 1
|
node.nbBrackets.value = 1
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Get timestamp
|
||||||
|
ymdhms = findMetadata(d, ["Exif:DateTimeOriginal", "DateTimeOriginal", "DateTime", "Date Time", "Create Date", "ctime"], "")
|
||||||
|
timestamp = -1
|
||||||
|
if ymdhms != "":
|
||||||
|
timestamp = LdrToHdrMerge.getTimestamp(ymdhms)
|
||||||
|
|
||||||
exposure = LdrToHdrMerge.getExposure((float(fnumber), float(shutterSpeed), float(iso)))
|
exposure = LdrToHdrMerge.getExposure((float(fnumber), float(shutterSpeed), float(iso)))
|
||||||
|
|
||||||
obj = avhdr.LuminanceInfo(viewpoint.viewId.value,viewpoint.path.value, exposure)
|
obj = avhdr.LuminanceInfo(viewpoint.viewId.value,viewpoint.path.value, exposure, timestamp)
|
||||||
inputs.append(obj)
|
inputs.append(obj)
|
||||||
|
|
||||||
obj = avhdr.estimateGroups(inputs)
|
obj = avhdr.estimateGroups(inputs)
|
||||||
|
@ -326,6 +332,21 @@ Merge LDR images into HDR images.
|
||||||
obj = avsfmdata.ExposureSetting(shutterSpeed, fnumber, iso)
|
obj = avsfmdata.ExposureSetting(shutterSpeed, fnumber, iso)
|
||||||
return obj.getExposure()
|
return obj.getExposure()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def getTimestamp(ymdhms):
|
||||||
|
import re
|
||||||
|
timecode = -1
|
||||||
|
if re.search("([\d]+):([\d]+):([\d]+) ([\d]+):([\d]+):([\d]+)", ymdhms) != None:
|
||||||
|
t = re.findall("([\d]+)(:| |)", ymdhms)
|
||||||
|
years = int(t[0][0])
|
||||||
|
months = int(t[1][0])
|
||||||
|
days = int(t[2][0])
|
||||||
|
hours = int(t[3][0])
|
||||||
|
minutes = int(t[4][0])
|
||||||
|
seconds = int(t[5][0])
|
||||||
|
timecode = ((((((((years * 12) + months) * 31) + days) * 24) + hours) * 60) + minutes) * 60 + seconds
|
||||||
|
return timecode
|
||||||
|
|
||||||
def processChunk(self, chunk):
|
def processChunk(self, chunk):
|
||||||
# Trick to avoid sending --nbBrackets to the command line when the bracket detection is automatic.
|
# Trick to avoid sending --nbBrackets to the command line when the bracket detection is automatic.
|
||||||
# Otherwise, the AliceVision executable has no way of determining whether the bracket detection was automatic
|
# Otherwise, the AliceVision executable has no way of determining whether the bracket detection was automatic
|
||||||
|
|
|
@ -258,9 +258,15 @@ Sample pixels from Low range images for HDR creation.
|
||||||
node.nbBrackets.value = 1
|
node.nbBrackets.value = 1
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Get timestamp
|
||||||
|
ymdhms = findMetadata(d, ["Exif:DateTimeOriginal", "DateTimeOriginal", "DateTime", "Date Time", "Create Date", "ctime"], "")
|
||||||
|
timestamp = -1
|
||||||
|
if ymdhms != "":
|
||||||
|
timestamp = LdrToHdrSampling.getTimestamp(ymdhms)
|
||||||
|
|
||||||
exposure = LdrToHdrSampling.getExposure((float(fnumber), float(shutterSpeed), float(iso)))
|
exposure = LdrToHdrSampling.getExposure((float(fnumber), float(shutterSpeed), float(iso)))
|
||||||
|
|
||||||
obj = avhdr.LuminanceInfo(viewpoint.viewId.value,viewpoint.path.value, exposure)
|
obj = avhdr.LuminanceInfo(viewpoint.viewId.value,viewpoint.path.value, exposure, timestamp)
|
||||||
inputs.append(obj)
|
inputs.append(obj)
|
||||||
|
|
||||||
obj = avhdr.estimateGroups(inputs)
|
obj = avhdr.estimateGroups(inputs)
|
||||||
|
@ -282,3 +288,18 @@ Sample pixels from Low range images for HDR creation.
|
||||||
fnumber, shutterSpeed, iso = exp
|
fnumber, shutterSpeed, iso = exp
|
||||||
obj = avsfmdata.ExposureSetting(shutterSpeed, fnumber, iso)
|
obj = avsfmdata.ExposureSetting(shutterSpeed, fnumber, iso)
|
||||||
return obj.getExposure()
|
return obj.getExposure()
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def getTimestamp(ymdhms):
|
||||||
|
import re
|
||||||
|
timecode = -1
|
||||||
|
if re.search("([\d]+):([\d]+):([\d]+) ([\d]+):([\d]+):([\d]+)", ymdhms) != None:
|
||||||
|
t = re.findall("([\d]+)(:| |)", ymdhms)
|
||||||
|
years = int(t[0][0])
|
||||||
|
months = int(t[1][0])
|
||||||
|
days = int(t[2][0])
|
||||||
|
hours = int(t[3][0])
|
||||||
|
minutes = int(t[4][0])
|
||||||
|
seconds = int(t[5][0])
|
||||||
|
timecode = ((((((((years * 12) + months) * 31) + days) * 24) + hours) * 60) + minutes) * 60 + seconds
|
||||||
|
return timecode
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue