|
| 1 | +__version__ = "1.0" |
| 2 | + |
| 3 | +from meshroom.core import desc |
| 4 | +from meshroom.core.utils import VERBOSE_LEVEL |
| 5 | + |
| 6 | + |
| 7 | +class CameraCalibration(desc.AVCommandLineNode): |
| 8 | + commandLine = 'aliceVision_cameraCalibration {allParams}' |
| 9 | + |
| 10 | + category = 'Utils' |
| 11 | + documentation = ''' |
| 12 | + ''' |
| 13 | + |
| 14 | + inputs = [ |
| 15 | + desc.File( |
| 16 | + name="input", |
| 17 | + label="Input", |
| 18 | + description="Input images in one of the following form:\n" |
| 19 | + " - folder containing images.\n" |
| 20 | + " - image sequence like \"/path/to/[email protected]\".\n" |
| 21 | + " - video file.", |
| 22 | + value="", |
| 23 | + ), |
| 24 | + desc.ChoiceParam( |
| 25 | + name="pattern", |
| 26 | + label="Pattern", |
| 27 | + description="Type of pattern (CHESSBOARD, CIRCLES, ASYMMETRIC_CIRCLES, ASYMMETRIC_CCTAG).", |
| 28 | + value="CHESSBOARD", |
| 29 | + values=["CHESSBOARD", "CIRCLES", "ASYMMETRIC_CIRCLES", "ASYMMETRIC_CCTAG"], |
| 30 | + ), |
| 31 | + desc.GroupAttribute( |
| 32 | + name="size", |
| 33 | + label="Size", |
| 34 | + description="Number of inner corners per one of board dimension like W H.", |
| 35 | + groupDesc=[ |
| 36 | + desc.IntParam( |
| 37 | + name="width", |
| 38 | + label="Width", |
| 39 | + description="", |
| 40 | + value=7, |
| 41 | + range=(0, 10000, 1), |
| 42 | + ), |
| 43 | + desc.IntParam( |
| 44 | + name="height", |
| 45 | + label="Height", |
| 46 | + description="", |
| 47 | + value=5, |
| 48 | + range=(0, 10000, 1), |
| 49 | + ), |
| 50 | + ], |
| 51 | + ), |
| 52 | + desc.FloatParam( |
| 53 | + name="squareSize", |
| 54 | + label="Square Size", |
| 55 | + description="Size of the grid's square cells (mm).", |
| 56 | + value=1.0, |
| 57 | + range=(0.0, 100.0, 1.0), |
| 58 | + ), |
| 59 | + desc.IntParam( |
| 60 | + name="nbDistortionCoef", |
| 61 | + label="Nb Distortion Coef", |
| 62 | + description="Number of distortion coefficients.", |
| 63 | + value=3, |
| 64 | + range=(0, 5, 1), |
| 65 | + ), |
| 66 | + desc.IntParam( |
| 67 | + name="maxFrames", |
| 68 | + label="Max Frames", |
| 69 | + description="Maximum number of frames to extract from the video file.", |
| 70 | + value=0, |
| 71 | + range=(0, 5, 1), |
| 72 | + ), |
| 73 | + desc.IntParam( |
| 74 | + name="maxCalibFrames", |
| 75 | + label="Max Calib Frames", |
| 76 | + description="Maximum number of frames to use to calibrate from the selected frames.", |
| 77 | + value=100, |
| 78 | + range=(0, 1000, 1), |
| 79 | + ), |
| 80 | + desc.IntParam( |
| 81 | + name="calibGridSize", |
| 82 | + label="Calib Grid Size", |
| 83 | + description="Define the number of cells per edge.", |
| 84 | + value=10, |
| 85 | + range=(0, 50, 1), |
| 86 | + ), |
| 87 | + desc.IntParam( |
| 88 | + name="minInputFrames", |
| 89 | + label="Min Input Frames", |
| 90 | + description="Minimum number of frames to limit the refinement loop.", |
| 91 | + value=10, |
| 92 | + range=(0, 100, 1), |
| 93 | + ), |
| 94 | + desc.FloatParam( |
| 95 | + name="maxTotalAvgErr", |
| 96 | + label="Max Total Avg Err", |
| 97 | + description="Maximum total average error.", |
| 98 | + value=0.10000000000000001, |
| 99 | + range=(0.0, 1.0, 0.01), |
| 100 | + ), |
| 101 | + desc.File( |
| 102 | + name="debugRejectedImgFolder", |
| 103 | + label="Debug Rejected Img Folder", |
| 104 | + description="Folder to export images that were deleted during the refinement loop.", |
| 105 | + value="", |
| 106 | + ), |
| 107 | + desc.File( |
| 108 | + name="debugSelectedImgFolder", |
| 109 | + label="Debug Selected Img Folder", |
| 110 | + description="Folder to export debug images.", |
| 111 | + value="", |
| 112 | + ), |
| 113 | + desc.ChoiceParam( |
| 114 | + name="verboseLevel", |
| 115 | + label="Verbose Level", |
| 116 | + description="Verbosity level (fatal, error, warning, info, debug, trace).", |
| 117 | + values=VERBOSE_LEVEL, |
| 118 | + value="info", |
| 119 | + ), |
| 120 | + ] |
| 121 | + |
| 122 | + outputs = [ |
| 123 | + desc.File( |
| 124 | + name="output", |
| 125 | + label="Output", |
| 126 | + description="Output filename for intrinsic [and extrinsic] parameters.", |
| 127 | + value="{nodeCacheFolder}/cameraCalibration.cal", |
| 128 | + ), |
| 129 | + ] |
0 commit comments