Meshroom
Meshroom copied to clipboard
[question] Trying to override the intrinsic parameters in the cameraInit node by cli
Describe the problem I am trying to override the intrinsic parameters in the cameraInit node by cli. For testing the pipeline contains only the cameraInit node. I am getting an error and have no idea if this is the right way. If I try to override other parameters such as defaultFieldOfView it works. Perhaps I have made a mistake with the types of paremeters? And is it possible to override only certain intrinsic parameters and not all of them, because this is a group attribute?
meshroom = path to meshroom_batch.exe
input = path to img folder
cache = path to cache
pipeline = path to pipeline
cli = meshroom + " --input " + input + " --cache " + cache + " --pipeline " + pipeline + \
" --paramOverrides CameraInit:intrinsics=2541497611,-1.0,1000.0,1.0,True,'',0,0,36.0,24.0,'',
{'x':0.0,'y':0.0},'none','none',[],{'x':0.0,'y':0.0},[],False"
subprocess.run(cli)
Log
Traceback (most recent call last):
File "C:\Release\sources\Meshroom\venv\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 40, in run
File "C:\Release\sources\Meshroom\venv\lib\site-packages\cx_Freeze\initscripts\Console.py", line 37, in run
File "bin/meshroom_batch", line 202, in <module>
File "C:\Release\sources\Meshroom\meshroom\core\graph.py", line 1574, in executeGraph
File "C:\Release\sources\Meshroom\meshroom\core\node.py", line 411, in process
File "C:\Release\sources\Meshroom\meshroom\nodes\aliceVision\CameraInit.py", line 470, in processChunk
File "C:\Release\sources\Meshroom\meshroom\core\desc.py", line 644, in processChunk
RuntimeError: Error on node "CameraInit_1": `
Desktop
- OS: win 10
- Python version: 3.10
- Meshroom version:
- Binary version 2023.2.0
You could input the parameters in the Meshroom node, run the node and copy the cli parameters from the console or log for later use and/or to get the correct syntax
Thank you for your answer. I imported the images in the gui, then changed the intrinsic parameters and ran the node. Is that what you mean?
This is the commandLine in the console:
[0x000041a8] [trace] Embedded OCIO configuration file: '\Meshroom-2023.2.0\aliceVision/share/aliceVision/config.ocio' found.
- commandLine: aliceVision_cameraInit --sensorDatabase "\Meshroom-2023.2.0\aliceVision\share\aliceVision\cameraSensors.db" --lensCorrectionProfileInfo "${ALICEVISION_LENS_PROFILE_INFO}" --lensCorrectionProfileSearchIgnoreCameraModel True --defaultFieldOfView 45.0 --groupCameraFallback folder --allowedCameraModels pinhole,radial1,radial3,brown,fisheye4,fisheye1,3deanamorphic4,3deradial4,3declassicld --rawColorInterpretation LibRawWhiteBalancing --viewIdMethod metadata --verboseLevel info --output "/MeshroomCache/CameraInit/f9e97d72f657fcd88f8e0aa563ee76441cc02823/cameraInit.sfm" --allowSingleView 1 --input "/MeshroomCache/CameraInit/f9e97d72f657fcd88f8e0aa563ee76441cc02823/viewpoints.sfm"
- logFile: /MeshroomCache/CameraInit/f9e97d72f657fcd88f8e0aa563ee76441cc02823/log
And this is how the log file looks like:
[0x0000229c] [trace] Embedded OCIO configuration file: '\Meshroom-2023.2.0\aliceVision/share/aliceVision/config.ocio' found.
Program called with the following parameters:
* allowSingleView = 1
* allowedCameraModels = "pinhole,radial1,radial3,brown,fisheye4,fisheye1,3deanamorphic4,3deradial4,3declassicld"
* colorProfileDatabase = "" (default)
* defaultCameraModel = "" (default)
* defaultFieldOfView = 45
* defaultFocalLength = -1 (default)
* defaultFocalRatio = 1 (default)
* defaultOffsetX = 0 (default)
* defaultOffsetY = 0 (default)
* errorOnMissingColorProfile = 1 (default)
* groupCameraFallback = Unknown Type "enum EGroupCameraFallback"
* imageFolder = "" (default)
* input = "/MeshroomCache/CameraInit/f9e97d72f657fcd88f8e0aa563ee76441cc02823/viewpoints.sfm"
* lensCorrectionProfileInfo = "${ALICEVISION_LENS_PROFILE_INFO}"
* lensCorrectionProfileSearchIgnoreCameraModel = 1
* maxCoresAvailable = Unknown Type "unsigned int" (default)
* maxMemoryAvailable = 18446744073709551615 (default)
* output = "/MeshroomCache/CameraInit/f9e97d72f657fcd88f8e0aa563ee76441cc02823/cameraInit.sfm"
* rawColorInterpretation = Unknown Type "enum aliceVision::image::ERawColorInterpretation"
* sensorDatabase = "\Meshroom-2023.2.0\aliceVision\share\aliceVision\cameraSensors.db"
* verboseLevel = "info"
* viewIdMethod = Unknown Type "enum aliceVision::sfmDataIO::EViewIdMethod"
* viewIdRegex = ".*?(\d+)" (default)
Hardware :
Detected core count : 4
OpenMP will use 4 cores
Detected available memory : 6676 Mo
[info] 0 profile(s) stored in the LCP database.
[info] CameraInit report:
- # Views: 72
- # with focal length initialization (from metadata): 72
- # without metadata: 0
- # with DCP color calibration (raw images only): 0
- # with LCP lens distortion initialization: 0
- # with LCP vignetting calibration: 0
- # Cameras Intrinsics: 1
Should the intrinsic parameters normally be there too? Am I doing something wrong?
Here you have all the commandLine parameters you can compare it to your cli call
aliceVision_cameraInit --sensorDatabase "\Meshroom-2023.2.0\aliceVision\share\aliceVision\cameraSensors.db" --lensCorrectionProfileInfo "${ALICEVISION_LENS_PROFILE_INFO}" --lensCorrectionProfileSearchIgnoreCameraModel True --defaultFieldOfView 45.0 --groupCameraFallback folder --allowedCameraModels pinhole,radial1,radial3,brown,fisheye4,fisheye1,3deanamorphic4,3deradial4,3declassicld --rawColorInterpretation LibRawWhiteBalancing --viewIdMethod metadata --verboseLevel info --output "/MeshroomCache/CameraInit/f9e97d72f657fcd88f8e0aa563ee76441cc02823/cameraInit.sfm" --allowSingleView 1 --input "/MeshroomCache/CameraInit/f9e97d72f657fcd88f8e0aa563ee76441cc02823/viewpoints.sfm"
Here is the whole output from the console if I try to run my cli command. At the end are the same commandLine parameters as when I run this via the gui. Is that what you mean by compare? Is it generally possible to change the intrinsic parameters via cli and paramOverrides?
\Meshroom-2023.2.0\meshroom_batch.exe --input \Test7\punktewolken_10_51_52\png\bilder_links_png --cache \MeshroomCache --pipeline \getCameraPositions.mg --paramOverrides CameraInit:intrinsics=3647802070,-1.0,1000.0,1.0,True,'',0,0,36.0,24.0,'',{'x':0.0,'y':0.0},'none','none',[],{'x':0.0,'y':0.0},[],False
[2024-01-15 16:08:30.808564] [0x00001ea4] [trace] Embedded OCIO configuration file: '\Meshroom-2023.2.0\aliceVision/share/aliceVision/config.ocio' found.
Program called with the following parameters:
* allowSingleView = 1
* allowedCameraModels = "pinhole,radial1,radial3,brown,fisheye4,fisheye1,3deanamorphic4,3deradial4,3declassicld"
* colorProfileDatabase = "" (default)
* defaultCameraModel = "" (default)
* defaultFieldOfView = 45
* defaultFocalLength = -1 (default)
* defaultFocalRatio = 1 (default)
* defaultOffsetX = 0 (default)
* defaultOffsetY = 0 (default)
* errorOnMissingColorProfile = 1 (default)
* groupCameraFallback = Unknown Type "enum EGroupCameraFallback"
* imageFolder = "" (default)
* input = "\AppData\Local\Temp\tmpvh3kbevz/CameraInit/961e54591174ec5a2457c66da8eadc0cb03d89ba/viewpoints.sfm"
* lensCorrectionProfileInfo = "${ALICEVISION_LENS_PROFILE_INFO}"
* lensCorrectionProfileSearchIgnoreCameraModel = 1
* maxCoresAvailable = Unknown Type "unsigned int" (default)
* maxMemoryAvailable = 18446744073709551615 (default)
* output = "/AppData/Local/Temp/tmpvh3kbevz/CameraInit/961e54591174ec5a2457c66da8eadc0cb03d89ba/cameraInit.sfm"
* rawColorInterpretation = Unknown Type "enum aliceVision::image::ERawColorInterpretation"
* sensorDatabase = "\Meshroom-2023.2.0\aliceVision\share\aliceVision\cameraSensors.db"
* verboseLevel = "info"
* viewIdMethod = Unknown Type "enum aliceVision::sfmDataIO::EViewIdMethod"
* viewIdRegex = ".*?(\d+)" (default)
Hardware :
Detected core count : 4
OpenMP will use 4 cores
Detected available memory : 7409 Mo
[16:08:30.878565][info] 0 profile(s) stored in the LCP database.
[16:08:30.879567][warning] Sensor size is unknown
[16:08:30.879567][warning] Use default sensor size (36 mm)
[16:08:30.879567][warning] Image 'bild_22_315.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.879567][warning] Sensor size is unknown
[16:08:30.879567][warning] Use default sensor size (36 mm)
[16:08:30.880565][warning] Image 'bild_21_300.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.880565][warning] Sensor size is unknown
[16:08:30.880565][warning] Use default sensor size (36 mm)
[16:08:30.880565][warning] Sensor size is unknown
[16:08:30.880565][warning] Image 'bild_17_240.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.880565][warning] Use default sensor size (36 mm)
[16:08:30.880565][warning] Sensor size is unknown
[16:08:30.880565][warning] Use default sensor size (36 mm)
[16:08:30.880565][warning] Image 'bild_14_195.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.880565][warning] Sensor size is unknown
[16:08:30.881565][warning] Use default sensor size (36 mm)
[16:08:30.881565][warning] Sensor size is unknown
[16:08:30.881565][warning] Use default sensor size (36 mm)
[16:08:30.881565][warning] Image 'bild_19_270.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.881565][warning] Image 'bild_8_105.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.881565][warning] Image 'bild_10_135.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.881565][warning] Sensor size is unknown
[16:08:30.881565][warning] Use default sensor size (36 mm)
[16:08:30.882564][warning] Image 'bild_24_345.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.882564][warning] Sensor size is unknown
[16:08:30.882564][warning] Sensor size is unknown
[16:08:30.882564][warning] Use default sensor size (36 mm)
[16:08:30.882564][warning] Use default sensor size (36 mm)
[16:08:30.882564][warning] Sensor size is unknown
[16:08:30.882564][warning] Use default sensor size (36 mm)
[16:08:30.882564][warning] Image 'bild_7_90.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.882564][warning] Image 'bild_5_60.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.883564][warning] Image 'bild_11_150.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.883564][warning] Sensor size is unknown
[16:08:30.883564][warning] Use default sensor size (36 mm)
[16:08:30.883564][warning] Image 'bild_6_75.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.883564][warning] Sensor size is unknown
[16:08:30.883564][warning] Use default sensor size (36 mm)
[16:08:30.884576][warning] Sensor size is unknown
[16:08:30.883564][warning] Image 'bild_13_180.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.884576][warning] Sensor size is unknown
[16:08:30.884576][warning] Use default sensor size (36 mm)
[16:08:30.884576][warning] Image 'bild_3_30.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.884576][warning] Sensor size is unknown
[16:08:30.884576][warning] Use default sensor size (36 mm)
[16:08:30.884576][warning] Use default sensor size (36 mm)
[16:08:30.884576][warning] Image 'bild_12_165.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.884576][warning] Sensor size is unknown
[16:08:30.885565][warning] Sensor size is unknown
[16:08:30.885565][warning] Use default sensor size (36 mm)
[16:08:30.885565][warning] Image 'bild_2_15.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.885565][warning] Use default sensor size (36 mm)
[16:08:30.886568][warning] Image 'bild_20_285.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.886568][warning] Sensor size is unknown
[16:08:30.886568][warning] Use default sensor size (36 mm)
[16:08:30.886568][warning] Image 'bild_4_45.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.886568][warning] Image 'bild_23_330.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.886568][warning] Sensor size is unknown
[16:08:30.886568][warning] Use default sensor size (36 mm)
[16:08:30.887565][warning] Sensor size is unknown
[16:08:30.887565][warning] Use default sensor size (36 mm)
[16:08:30.887565][warning] Image 'bild_18_255.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.887565][warning] Sensor size is unknown
[16:08:30.887565][warning] Use default sensor size (36 mm)
[16:08:30.887565][warning] Image 'bild_16_225.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.888564][warning] Image 'bild_15_210.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.888564][warning] Sensor size is unknown
[16:08:30.888564][warning] Use default sensor size (36 mm)
[16:08:30.888564][warning] Image 'bild_9_120.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.888564][warning] Sensor size is unknown
[16:08:30.888564][warning] Use default sensor size (36 mm)
[16:08:30.888564][warning] Image 'bild_1_0.0_grad_links.png' focal length (in mm) metadata is missing.
Can't compute focal length, use default.
[16:08:30.888564][warning] Some image(s) have no serial number to identify the camera/lens device.
This makes it impossible to correctly group the images by device if you have used multiple identical (same model) camera devices.
The reconstruction will assume that only one device has been used, so if 2 images share the same focal length approximation they will share the same internal camera parameters.
24 image(s) are concerned.
[16:08:30.894565][info] CameraInit report:
- # Views: 24
- # with focal length initialization (from metadata): 24
- # without metadata: 24
- # with DCP color calibration (raw images only): 0
- # with LCP lens distortion initialization: 0
- # with LCP vignetting calibration: 0
- # Cameras Intrinsics: 1
ERROR:root:Error on node computation: Error on node "CameraInit_1":
Log:
[2024-01-15 16:08:31.774564] [0x000011a0] [trace] Embedded OCIO configuration file: '\Meshroom-2023.2.0\aliceVision/share/aliceVision/config.ocio' found.
Program called with the following parameters:
* allowSingleView = 1
* allowedCameraModels = "pinhole,radial1,radial3,brown,fisheye4,fisheye1,3deanamorphic4,3deradial4,3declassicld"
* colorProfileDatabase = "" (default)
* defaultCameraModel = "" (default)
* defaultFieldOfView = 45
* defaultFocalLength = -1 (default)
* defaultFocalRatio = 1 (default)
* defaultOffsetX = 0 (default)
* defaultOffsetY = 0 (default)
* errorOnMissingColorProfile = 1 (default)
* groupCameraFallback = Unknown Type "enum EGroupCameraFallback"
* imageFolder = "" (default)
* input = "/MeshroomCache/CameraInit/a6e8f74adffa4dd85e7cc7f2c70649b58af7409c/viewpoints.sfm"
* lensCorrectionProfileInfo = "${ALICEVISION_LENS_PROFILE_INFO}"
* lensCorrectionProfileSearchIgnoreCameraModel = 1
* maxCoresAvailable = Unknown Type "unsigned int" (default)
* maxMemoryAvailable = 18446744073709551615 (default)
* output = "/MeshroomCache/CameraInit/a6e8f74adffa4dd85e7cc7f2c70649b58af7409c/cameraInit.sfm"
* rawColorInterpretation = Unknown Type "enum aliceVision::image::ERawColorInterpretation"
* sensorDatabase = "\Meshroom-2023.2.0\aliceVision\share\aliceVision\cameraSensors.db"
* verboseLevel = "info"
* viewIdMethod = Unknown Type "enum aliceVision::sfmDataIO::EViewIdMethod"
* viewIdRegex = ".*?(\d+)" (default)
Hardware :
Detected core count : 4
OpenMP will use 4 cores
Detected available memory : 7375 Mo
[16:08:31.792564][fatal]
Traceback (most recent call last):
File "C:\Release\sources\Meshroom\venv\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 40, in run
File "C:\Release\sources\Meshroom\venv\lib\site-packages\cx_Freeze\initscripts\Console.py", line 37, in run
File "bin/meshroom_batch", line 202, in <module>
File "C:\Release\sources\Meshroom\meshroom\core\graph.py", line 1574, in executeGraph
File "C:\Release\sources\Meshroom\meshroom\core\node.py", line 411, in process
File "C:\Release\sources\Meshroom\meshroom\nodes\aliceVision\CameraInit.py", line 470, in processChunk
File "C:\Release\sources\Meshroom\meshroom\core\desc.py", line 644, in processChunk
RuntimeError: Error on node "CameraInit_1":
Log:
[2024-01-15 16:08:31.774564] [0x000011a0] [trace] Embedded OCIO configuration file: '\Meshroom-2023.2.0\aliceVision/share/aliceVision/config.ocio' found.
Program called with the following parameters:
* allowSingleView = 1
* allowedCameraModels = "pinhole,radial1,radial3,brown,fisheye4,fisheye1,3deanamorphic4,3deradial4,3declassicld"
* colorProfileDatabase = "" (default)
* defaultCameraModel = "" (default)
* defaultFieldOfView = 45
* defaultFocalLength = -1 (default)
* defaultFocalRatio = 1 (default)
* defaultOffsetX = 0 (default)
* defaultOffsetY = 0 (default)
* errorOnMissingColorProfile = 1 (default)
* groupCameraFallback = Unknown Type "enum EGroupCameraFallback"
* imageFolder = "" (default)
* input = "/MeshroomCache/CameraInit/a6e8f74adffa4dd85e7cc7f2c70649b58af7409c/viewpoints.sfm"
* lensCorrectionProfileInfo = "${ALICEVISION_LENS_PROFILE_INFO}"
* lensCorrectionProfileSearchIgnoreCameraModel = 1
* maxCoresAvailable = Unknown Type "unsigned int" (default)
* maxMemoryAvailable = 18446744073709551615 (default)
* output = "/MeshroomCache/CameraInit/a6e8f74adffa4dd85e7cc7f2c70649b58af7409c/cameraInit.sfm"
* rawColorInterpretation = Unknown Type "enum aliceVision::image::ERawColorInterpretation"
* sensorDatabase = "\Meshroom-2023.2.0\aliceVision\share\aliceVision\cameraSensors.db"
* verboseLevel = "info"
* viewIdMethod = Unknown Type "enum aliceVision::sfmDataIO::EViewIdMethod"
* viewIdRegex = ".*?(\d+)" (default)
Hardware :
Detected core count : 4
OpenMP will use 4 cores
Detected available memory : 7375 Mo
[16:08:31.792564][fatal]
Overrides CameraInit.intrinsics=3647802070,-1.0,1000.0,1.0,True,'',0,0,36.0,24.0,'',{'x':0.0,'y':0.0},'none','none',[],{'x':0.0,'y':0.0},[],False
No output set, results will be available in the cache folder: "/MeshroomCache"
Nodes to execute: ['CameraInit_1']
[1/1] CameraInit
- commandLine: aliceVision_cameraInit --sensorDatabase "\Meshroom-2023.2.0\aliceVision\share\aliceVision\cameraSensors.db" --lensCorrectionProfileInfo "${ALICEVISION_LENS_PROFILE_INFO}" --lensCorrectionProfileSearchIgnoreCameraModel True --defaultFieldOfView 45.0 --groupCameraFallback folder --allowedCameraModels pinhole,radial1,radial3,brown,fisheye4,fisheye1,3deanamorphic4,3deradial4,3declassicld --rawColorInterpretation LibRawWhiteBalancing --viewIdMethod metadata --verboseLevel info --output "/MeshroomCache/CameraInit/a6e8f74adffa4dd85e7cc7f2c70649b58af7409c/cameraInit.sfm" --allowSingleView 1 --input "/MeshroomCache/CameraInit/a6e8f74adffa4dd85e7cc7f2c70649b58af7409c/viewpoints.sfm"
- logFile:/MeshroomCache/CameraInit/a6e8f74adffa4dd85e7cc7f2c70649b58af7409c/log