Table of Contents
We are in the process of digitalizing our Entomological Collection. To optimize the process we are doing experiments and writing scripts to automate most of the process. In this documentation, we are sharing our scripts and process optimizations. It is important to note that the hardware with which the images are made to process the 3d model is from Small World Vision. The information gathered from the hardware is needed for most of the scripts.
To get a local copy up and running follow these steps below.
Software:
- Disc3D
- Metashape
Hardware:
- Small world vision - Insect scanner DISC3D
Download all the files for the corresponding Metashape version under 'Insect-Scanner/Metashape/Script/Version X.X/'. Or you can simply download it here. Save the folder with the same folder structure where the .py files are contained.
For the script to work some adjustments need to be made inside the python script. To edit the script we recommend Visual Studio Code.
Calibration:
All settings and calibrations can be done in the setting.py file inside the variable folder.
- Create a folder where two files will be stored that are needed for the calibration
- Open the folder from the DISC3D process where the desired calibration was used
- Copy the file 'CamPos.txt' to the folder created in step 1
- Go back to the folder from the DISC3D process
- Open 'ScanInformation.pdf'
- Copy the value for '2.4. Camera Constant/f [px]'
- Load the images into Metashape (Workflow>Add Folder)
- Go to Tool>Camera Calibration
- Under the initial change Type from 'Auto' to 'Precalibrated'
- Paste the copied value from step 6 into 'f'
- Click the save icon
- Save the file to the folder created in step 1 (specific name not needed. We use 'CamCalibration')
- Open the file 'setting.py' inside the 'variable' folder
- Change the value for 'calibFolder' to the path of the folder created in step 1
calibFolder = "FOLDER_PATH"
- Change the value for 'referenceFilename' to the file name of the file copied in step 3 (usually 'CamPos')
referenceFilename = "CAMPOS_NAME"
- Change the value for 'CamCalibration' to the file name of the file created in step 12 (usually 'CamCalibration')
CamCalibration = "CAMCALIBRATION_NAME"
- Save the script File>Save
For more information, you are welcome to contact us.
To run the scripts you have to start them inside of Metashape:
- Go to Tools>Run Script (Shortcut: Ctrl+R)
- Select the folder icon
- Browse for the desired script and open it
- Press OK
The script will now go through and ask for the specified folder.
There are four different scripts:
-
BatchScript
process one insect to a 3d model -
BatchScript_FastCalculation
process one insect to a 3d model with the addition that the calculation will be approx. 3x faster with minimal loss of quality. Can be used for experimenting -
Multi_BatchScript
process multiple insects to 3d models at once (select each folder) -
Multi_BatchScript_SingleFolder
process multiple insects to 3d models at once (select main folder) -
Model_Exporter
export multiple insect 3d models to obj at once
For more information, you are welcome to contact us.
Any contributions are greatly appreciated.
If you have a suggestion, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/NewFeature
) - Commit your Changes (
git commit -m 'Add some NewFeature'
) - Push to the Branch (
git push origin feature/NewFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.txt
for more information.
Dr. Michael Greeff - [email protected]
Christian Felsner - [email protected]
Ernst Herb - [email protected]