Add Camera to database - alicevision/Meshroom GitHub Wiki

The import fails? (#179/#287) You can add your own Camera and Sensor by adding a new line to the camerasensor.db located in ..\Meshroom-2021.1.0\aliceVision\share\aliceVision\ (you can use any text editor). Before editing the database, close Meshroom. Edit and save the edited file.

The format is:

CameraMaker;CameraModel;SensorWidth(mm);source

cdb

Example: You have a Canon Digital IXUS 100. Look up your camera model. Most models can be found on https://www.digicamdb.com or devicespecifications.com. You can find the camera sensor of your mobile phone by using a device info app or searching the web.

If you have your Sensor in Inches, you can look up the width from the following table: https://www.digicamdb.com/sensor-sizes/

Canon Digital IXUS 100 Sensor: 1/2.3" (~6.16 x 4.62mm)

Insert the following line to the database:

Canon;Canon Digital IXUS 100;6.16;digicamdb

(Camera maker and model have to match your EXIF data)

Video tutorial

Calculate sensor width

In some cases the pixel size is provided. With the maximum image resolution it can be used to calculate the sensor width.

Example: The Xiaomi Redmi Note 8 uses a isocell bright gm2 sensor for the main camera. From the manufacturer we get the resolution (8000x6000) and pixel size (0.8μm). Pixel size can also be found here.

This calculator can be used to calculate the sensor length, but basically you can use this formula:

xresolution * μmvalue/1000=mmwidth that is 8000 * 0.8/1000=6.4

Lists of commonly used sensors:

https://en.wikipedia.org/wiki/Exmor

https://en.wikipedia.org/wiki/Samsung_CMOS

Sometimes you can guess from the image resolution and a specific feature like BSI the sensor from the wiki list that is likely used in your model.

Example: A smartphone camera with 8MP, 3264 x 2448 Samsung sensor with BSI

In this list the only sensor with BSI & 3264 x 2448 is the ISOCELL 4H5 with 1.12 μm.

Good to know

Meshroom can estimate the sensor width. Remove model and make info from the metadata (to avoid "not found in db"), import the image to Meshroom then hover over the yellow icon. est

The "Warning: SerialNumber metadata missing (...) is only important when using a camera Rig or when using images from different camera models.


Contribute to sensor database You can create a Pull request for your AliceVision/src/aliceVision/sensorDB/cameraSensors.db When adding may devices, use the AliceVision/src/aliceVision/sensorDB/sensorDatabaseSort.py script to sort the list.


Meshroom can handle brand and model variations:

Detected from metadata:

- image camera brand: Nikon
- image camera model: D500

found in database:

- database camera brand: Nikon
- database camera model: Nikon D500
- database camera sensor size: 23.5 mm

followed by

- "[warning] Please check and correct camera model(s) name in the database."

The goal of the warning is to allow users to check the mapping.

In this case the mapping between "Nikon/D500" and "Nikon/Nikon D500" is obviously fine.

This will not impact the result as far as the mapping is correct.

As there is no good way to deal with this mapping, we prefer to keep a warning to ensure that we don't get a border case mapping together 2 completely different cameras.

#625


If your camera is in the database, check if the sensor width your camera in the cameraSensors.db file is incorrect. In some cases the value might be wrong. By default only the main/front camera of mobile phones is added to the database. In case you captured images with your selfie camera, you need to modify the database accordingly.


Exif problems: (#289/ #287/ #179/ #207/ #208) -> Meshroom asks to add camera info to database, even if it already exists.

Workaround: Check the EXIF data of your images in IrfanView and make sure it matches the sensor database entry. Some cameras use extra EXIF fields which cause an error when importing images to Meshroom. To fix this problem, strip all uncommon EXIF data and add Make and Model. Now the Meshroom import should work. https://github.com/alicevision/meshroom/issues/205#issuecomment-425863617 You can use Exif tools like Exif Editor or ExifToolGUI.


Error messages:

[11:22:32.258715][error] Sensor width doesn't exist in the database for image(s) :

[11:22:32.258715][error] image: '2387_a.jpg' --> use the following information for the sensor database entry

camera brand: Capture --> if empty, add the brand/Make to the Exif data or use ;camera model;width

camera model: D23 --> the camera model can differ from the official model name. It might be in the database file but under a different name. Change the Exif or the database to match

[11:22:32.271921][error] Please add camera model(s) and sensor width(s) in the database.

--> Effects:

  1. image can not be imported into Meshroom

  2. image can be imported, but has "No camera Intrinsic parameters (Missing Metadata)", therefore can not be used for reconstruction


Sometimes images can be imported and processed even if no Brand or Model is provided, using other metadata:

[11:52:33.989404][info] Sensor width computed from 'FocalLength' and 'FocalLengthIn35mmFilm' metadata. - sensor width: 4.44435 mm - focal length: 4.28 mm

Relation between Focal Length, Field of View (Fov) and Sensor width

sensorwidth

Focal length can be found in image exif (exiftool -FocalLength -n image.jpg)
Test with your sensor numbers