This script was made to simplify the process from this guide: https://gist.github.com/jo-chemla/258e6e40d3d6c2220b29518ff3c17c40 by jo-chemla
This repository contains a Python script designed to automate the process of converting images and data from RealityCapture to a format compatible with Postshot via Colmap.
- Ensure you have Python installed on your system, and the
pip
package manager is functional. - Install Colmap on your system. You can download it from the Colmap github.
- Ensure that
colmap.exe
andcolmap.bat
are exposed on your computer's PATH environment variable. This means that you should be able to runcolmap
from any directory in the command line.
(location of colmap.bat)
E:\Program Files\Colmap\COLMAP-3.9.1-windows-cuda
(location of colmap.exe)
E:\Program Files\Colmap\COLMAP-3.9.1-windows-cuda\bin
These two paths should be added to your system's PATH as environment variables.
Clone this repository to your local machine using:
git clone https://github.com/Maxiviper117/RealityCapture-to-Postshot
Navigate to the cloned directory:
cd RealityCapture-to-Postshot
Choose a folder to store the exported file.
- Set
Fit
option toInner Region
. - Set
Resolution
option toFit
. - Ensure
Export Images
is set toNo
.- We will export the images separately in the next step when exporting the
Undistorted images with image list.
export option
- We will export the images separately in the next step when exporting the
Choose a folder to store the exported file.
- Set
Fit
option toInner Region
. - Set
Resolution
option toFit
. - Under
Export image settings
, choose the desired image format (preferablyjpg
orjpeg
). - Set
Naming Convention
tooriginal file name
. - Enable
Customize image path
and select the folder to store images. - (Optional) Adjust the
Downscale
option if required.
The script requires the following directory arguments:
--images_dir
: The path to the folder containing the undistorted images. (The folder selected in the previous step for the undistorted images)--working_dir
: The path to the folder containing the.out
and.lst
files. (The folder selected in the first step)--output_dir
: (OPTIONAL) - The path to the folder where the script will output the Colmap workspace. (defaults to a folder namedcolmap-workspace
in the working directory)
py RealityCaptureToColmap.v2.py --working_dir "<full path to working directory from previous export step 1>" --images_dir "<full path to images folder from previous export step 2>"
Option choose the output directory:
py RealityCaptureToColmap.v2.py --working_dir "<full path to working directory from previous export step 1>" --images_dir "<full path to images folder from previous export step 2>" --output_dir "<full path to output directory>"
Run the script from the command line. It will install the necessary kapture
package into your Python environment and process the provided directories.
Upon successful execution, the script outputs a colmap-workspace
(or the specified output directory) folder in the working directory with subfolders for different dataset stages. The dataset-colmap
folder contains the necessary files for Postshot import. Look for the .bin
files in dataset-colmap\sparse\0
.
Copy the all three cameras.bin
, images.bin
and points3D.bin
file (from the <output_dir>\dataset-colmap\sparse\0
folder) and the images (exported from RealityCapture) into the same folder. (Either all three bin files in that same images folder or all images and bin files in a new folder)
Then simply drag and drop the folder into Postshot to start the import process.
You should see this pop-up window, showing Camera Poses
set to import
. (this means the that it imported the cameras.bin file successfully), you can now start training.
If you see this error, when you drag and drop the folder into Postshot, try close and open Postshot again, and drag and drop the folder again.
Another way to import the data into Postshot is to first import the images separately, when the pop-up window appears, uncheck option start training
then click import.
Then select the image set, then at the bottom right corner, under Actions
fold, click on Import Camera Poses
and select the cameras.bin
file.