mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-18 19:46:26 +02:00
[nodes] New node CameraLocalization
This commit is contained in:
parent
4171d5c5da
commit
0291033b85
1 changed files with 222 additions and 0 deletions
222
meshroom/nodes/aliceVision/CameraLocalization.py
Normal file
222
meshroom/nodes/aliceVision/CameraLocalization.py
Normal file
|
@ -0,0 +1,222 @@
|
|||
import sys, os
|
||||
from meshroom.core import desc
|
||||
|
||||
|
||||
class CameraLocalization(desc.CommandLineNode):
|
||||
internalFolder = '{cache}/{nodeType}/{uid0}/'
|
||||
commandLine = 'aliceVision_cameraLocalization {allParams}'
|
||||
|
||||
inputs = [
|
||||
desc.File(
|
||||
name='sfmdata',
|
||||
label='SfM Data',
|
||||
description='''The sfm_data.json kind of file generated by AliceVision.''',
|
||||
value='',
|
||||
uid=[0],
|
||||
),
|
||||
desc.File(
|
||||
name='mediafile',
|
||||
label='Media File',
|
||||
description='''The folder path or the filename for the media to track''',
|
||||
value='',
|
||||
uid=[0],
|
||||
),
|
||||
desc.File(
|
||||
name='visualDebug',
|
||||
label='Visual Debug Folder',
|
||||
description='''If a folder is provided it enables visual debug and saves all the debugging info in that folder''',
|
||||
value='',
|
||||
uid=[0],
|
||||
),
|
||||
desc.File(
|
||||
name='descriptorPath',
|
||||
label='Descriptor Path',
|
||||
description='''Folder containing the descriptors for all the images (ie the *.desc.)''',
|
||||
value='',
|
||||
uid=[0],
|
||||
),
|
||||
desc.ChoiceParam(
|
||||
name='matchDescTypes',
|
||||
label='Match Desc Types',
|
||||
description='''Describer types to use for the matching.''',
|
||||
value=['SIFT'],
|
||||
values=['SIFT', 'SIFT_FLOAT', 'AKAZE', 'AKAZE_LIOP', 'AKAZE_MLDB', 'CCTAG3', 'CCTAG4', 'SIFT_OCV', 'AKAZE_OCV'],
|
||||
exclusive=False,
|
||||
uid=[0],
|
||||
joinChar=',',
|
||||
),
|
||||
desc.ChoiceParam(
|
||||
name='preset',
|
||||
label='Preset',
|
||||
description='''Preset for the feature extractor when localizing a new image {LOW,MEDIUM,NORMAL,HIGH,ULTRA}''',
|
||||
value='NORMAL',
|
||||
values=['LOW', 'MEDIUM', 'NORMAL', 'HIGH', 'ULTRA'],
|
||||
exclusive=True,
|
||||
uid=[0],
|
||||
),
|
||||
desc.ChoiceParam(
|
||||
name='resectionEstimator',
|
||||
label='Resection Estimator',
|
||||
description='''The type of *sac framework to use for resection (acransac, loransac)''',
|
||||
value='acransac',
|
||||
values=['acransac', 'loransac'],
|
||||
exclusive=True,
|
||||
uid=[0],
|
||||
),
|
||||
desc.ChoiceParam(
|
||||
name='matchingEstimator',
|
||||
label='Matching Estimator',
|
||||
description='''The type of *sac framework to use for matching (acransac, loransac)''',
|
||||
value='acransac',
|
||||
values=['acransac', 'loransac'],
|
||||
exclusive=True,
|
||||
uid=[0],
|
||||
),
|
||||
desc.File(
|
||||
name='calibration',
|
||||
label='Calibration',
|
||||
description='''Calibration file''',
|
||||
value='',
|
||||
uid=[0],
|
||||
),
|
||||
desc.BoolParam(
|
||||
name='refineIntrinsics',
|
||||
label='Refine Intrinsics',
|
||||
description='''Enable/Disable camera intrinsics refinement for each localized image''',
|
||||
value=False,
|
||||
uid=[0],
|
||||
),
|
||||
desc.FloatParam(
|
||||
name='reprojectionError',
|
||||
label='Reprojection Error',
|
||||
description='''Maximum reprojection error (in pixels) allowed for resectioning. If set to 0 it lets the ACRansac select an optimal value.''',
|
||||
value=4.0,
|
||||
range=(0.1, 50.0, 0.1),
|
||||
uid=[0],
|
||||
),
|
||||
desc.IntParam(
|
||||
name='nbImageMatch',
|
||||
label='Nb Image Match',
|
||||
description='''[voctree] Number of images to retrieve in database''',
|
||||
value=4,
|
||||
range=(1, 1000, 1),
|
||||
uid=[0],
|
||||
),
|
||||
desc.IntParam(
|
||||
name='maxResults',
|
||||
label='Max Results',
|
||||
description='''[voctree] For algorithm AllResults, it stops the image matching when this number of matched images is reached. If 0 it is ignored.''',
|
||||
value=10,
|
||||
range=(1, 100, 1),
|
||||
uid=[0],
|
||||
),
|
||||
desc.IntParam(
|
||||
name='commonviews',
|
||||
label='Commonviews',
|
||||
description='''[voctree] Number of minimum images in which a point must be seen to be used in cluster tracking''',
|
||||
value=3,
|
||||
range=(2, 50, 1),
|
||||
uid=[0],
|
||||
),
|
||||
desc.File(
|
||||
name='voctree',
|
||||
label='Voctree',
|
||||
description='''[voctree] Filename for the vocabulary tree''',
|
||||
value=os.environ.get('ALICEVISION_VOCTREE', ''),
|
||||
uid=[0],
|
||||
),
|
||||
desc.File(
|
||||
name='voctreeWeights',
|
||||
label='Voctree Weights',
|
||||
description='''[voctree] Filename for the vocabulary tree weights''',
|
||||
value='',
|
||||
uid=[0],
|
||||
),
|
||||
desc.ChoiceParam(
|
||||
name='algorithm',
|
||||
label='Algorithm',
|
||||
description='''[voctree] Algorithm type: FirstBest, AllResults''',
|
||||
value='AllResults',
|
||||
values=['FirstBest', 'AllResults'],
|
||||
exclusive=True,
|
||||
uid=[0],
|
||||
),
|
||||
desc.FloatParam(
|
||||
name='matchingError',
|
||||
label='Matching Error',
|
||||
description='''[voctree] Maximum matching error (in pixels) allowed for image matching with geometric verification. If set to 0 it lets the ACRansac select an optimal value.''',
|
||||
value=4.0,
|
||||
range=(0.0, 50.0, 1.0),
|
||||
uid=[0],
|
||||
),
|
||||
desc.IntParam(
|
||||
name='nbFrameBufferMatching',
|
||||
label='Nb Frame Buffer Matching',
|
||||
description='''[voctree] Number of previous frame of the sequence to use for matching (0 = Disable)''',
|
||||
value=10,
|
||||
range=(0, 100, 1),
|
||||
uid=[0],
|
||||
),
|
||||
desc.BoolParam(
|
||||
name='robustMatching',
|
||||
label='Robust Matching',
|
||||
description='''[voctree] Enable/Disable the robust matching between query and database images, all putative matches will be considered.''',
|
||||
value=True,
|
||||
uid=[0],
|
||||
),
|
||||
desc.IntParam(
|
||||
name='nNearestKeyFrames',
|
||||
label='N Nearest Key Frames',
|
||||
description='''[cctag] Number of images to retrieve in the database Parameters specific for final (optional) bundle adjustment optimization of the sequence:''',
|
||||
value=5,
|
||||
range=(1, 100, 1),
|
||||
uid=[0],
|
||||
),
|
||||
desc.StringParam(
|
||||
name='globalBundle',
|
||||
label='Global Bundle',
|
||||
description='''[bundle adjustment] If --refineIntrinsics is not set, this option allows to run a final global bundle adjustment to refine the scene.''',
|
||||
value='',
|
||||
uid=[0],
|
||||
),
|
||||
desc.BoolParam(
|
||||
name='noDistortion',
|
||||
label='No Distortion',
|
||||
description='''[bundle adjustment] It does not take into account distortion during the BA, it consider the distortion coefficients all equal to 0''',
|
||||
value=False,
|
||||
uid=[0],
|
||||
),
|
||||
desc.BoolParam(
|
||||
name='noBArefineIntrinsics',
|
||||
label='No BA Refine Intrinsics',
|
||||
description='''[bundle adjustment] It does not refine intrinsics during BA''',
|
||||
value=False,
|
||||
uid=[0],
|
||||
),
|
||||
desc.IntParam(
|
||||
name='minPointVisibility',
|
||||
label='Min Point Visibility',
|
||||
description='''[bundle adjustment] Minimum number of observation that a point must have in order to be considered for bundle adjustment''',
|
||||
value=2,
|
||||
range=(2, 50, 1),
|
||||
uid=[0],
|
||||
),
|
||||
]
|
||||
|
||||
outputs = [
|
||||
desc.File(
|
||||
name='outputAlembic',
|
||||
label='Output Alembic',
|
||||
description='''Filename for the SfMData export file (where camera poses will be stored)''',
|
||||
value='{cache}/{nodeType}/{uid0}/trackedCameras.abc',
|
||||
uid=[],
|
||||
),
|
||||
desc.File(
|
||||
name='outputBinary',
|
||||
label='Output Binary',
|
||||
description='''Filename for the localization results (raw data) as .bin''',
|
||||
value='{cache}/{nodeType}/{uid0}/trackedCameras.bin',
|
||||
uid=[],
|
||||
),
|
||||
]
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue