mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-21 10:37:18 +02:00
[cameraInit] add support for non square pixels
This commit is contained in:
parent
0dc6bb9c10
commit
248b14eb62
1 changed files with 11 additions and 1 deletions
|
@ -34,7 +34,10 @@ Intrinsic = [
|
||||||
"So this value is used to limit the range of possible values in the optimization. \n"
|
"So this value is used to limit the range of possible values in the optimization. \n"
|
||||||
"If you put -1, this value will not be used and the focal length will not be bounded.",
|
"If you put -1, this value will not be used and the focal length will not be bounded.",
|
||||||
value=-1.0, uid=[0], range=None),
|
value=-1.0, uid=[0], range=None),
|
||||||
desc.FloatParam(name="pxFocalLength", label="Focal Length", description="Known/Calibrated Focal Length (in pixels)", value=-1.0, uid=[0], range=None),
|
desc.GroupAttribute(name="pxFocalLength", label="Focal Length", description="Known/Calibrated Focal Length (in pixels)", groupDesc=[
|
||||||
|
desc.FloatParam(name="x", label="x", description="", value=-1, uid=[], range=(0, 10000, 1)),
|
||||||
|
desc.FloatParam(name="y", label="y", description="", value=-1, uid=[], range=(0, 10000, 1)),
|
||||||
|
]),
|
||||||
desc.ChoiceParam(name="type", label="Camera Type",
|
desc.ChoiceParam(name="type", label="Camera Type",
|
||||||
description="Mathematical Model used to represent a camera:\n"
|
description="Mathematical Model used to represent a camera:\n"
|
||||||
" * pinhole: Simplest projective camera model without optical distortion (focal and optical center).\n"
|
" * pinhole: Simplest projective camera model without optical distortion (focal and optical center).\n"
|
||||||
|
@ -100,6 +103,12 @@ def readSfMData(sfmFile):
|
||||||
intrinsic['principalPoint'] = {}
|
intrinsic['principalPoint'] = {}
|
||||||
intrinsic['principalPoint']['x'] = pp[0]
|
intrinsic['principalPoint']['x'] = pp[0]
|
||||||
intrinsic['principalPoint']['y'] = pp[1]
|
intrinsic['principalPoint']['y'] = pp[1]
|
||||||
|
|
||||||
|
f = intrinsic['pxFocalLength']
|
||||||
|
intrinsic['pxFocalLength'] = {}
|
||||||
|
intrinsic['pxFocalLength']['x'] = f[0]
|
||||||
|
intrinsic['pxFocalLength']['y'] = f[1]
|
||||||
|
|
||||||
# convert empty string distortionParams (i.e: Pinhole model) to empty list
|
# convert empty string distortionParams (i.e: Pinhole model) to empty list
|
||||||
if intrinsic['distortionParams'] == '':
|
if intrinsic['distortionParams'] == '':
|
||||||
intrinsic['distortionParams'] = list()
|
intrinsic['distortionParams'] = list()
|
||||||
|
@ -298,6 +307,7 @@ The metadata needed are:
|
||||||
intrinsics = node.intrinsics.getPrimitiveValue(exportDefault=True)
|
intrinsics = node.intrinsics.getPrimitiveValue(exportDefault=True)
|
||||||
for intrinsic in intrinsics:
|
for intrinsic in intrinsics:
|
||||||
intrinsic['principalPoint'] = [intrinsic['principalPoint']['x'], intrinsic['principalPoint']['y']]
|
intrinsic['principalPoint'] = [intrinsic['principalPoint']['x'], intrinsic['principalPoint']['y']]
|
||||||
|
intrinsic['pxFocalLength'] = [intrinsic['pxFocalLength']['x'], intrinsic['pxFocalLength']['y']]
|
||||||
views = node.viewpoints.getPrimitiveValue(exportDefault=False)
|
views = node.viewpoints.getPrimitiveValue(exportDefault=False)
|
||||||
|
|
||||||
# convert the metadata string into a map
|
# convert the metadata string into a map
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue