Omni-SFM is a Structure-from-Motion (SfM) pipeline implementation for omnidirectional imagery. The project provides tools for processing panoramic images and reconstructing 3D scenes using both command-line COLMAP and pycolmap implementations.
Sparse reconstruction with camera rig constraints:
Close-up view of sparse reconstruction showing camera rig alignment:
- Support for both command-line COLMAP and pycolmap workflows
- Panoramic image processing capabilities
- Rig-based SfM pipeline
- Modular architecture for easy extension
- Python 3.8+
- COLMAP installed (for command-line version)
- CUDA-enabled GPU recommended
# Clone repository
git clone https://github.com/your-repo/omni-sfm.git
cd omni-sfm
# Install with pip (recommended)
pip install -r requirements.txt
-
For command-line COLMAP:
Follow COLMAP installation instructions for your platform.
-
For ComfyUI integration:
Follow ComfyUI installation instructions for your platform.
Run the GUI application:
python app.py
Gradio UI:
Output data structure:
outputs/20250602xxxxxx/pinhole_images
├── images
│ ├── pitch_-35_yaw_-90
│ ├── pitch_-35_yaw_0
│ ├── pitch_-35_yaw_180
│ ├── pitch_-35_yaw_90
│ ├── pitch_35_yaw_-90
│ ├── pitch_35_yaw_0
│ ├── pitch_35_yaw_180
│ └── pitch_35_yaw_90
├── camera_params.json
└── rig_config.json
The project includes several scripts in the scripts/
directory:
-
run_cmd_colmap_rig_sfm.py Runs the SfM pipeline using command-line COLMAP with rig support.
Parameters:
--image_path
: Path to input images directory (required)--output_path
: Path to output directory (required)--rig_config
: Path to rig configuration JSON file (required)--camera_config
: Path to camera parameters JSON file (required)--camera_model
: Camera model type (default: "PINHOLE", options: ["PINHOLE", "SIMPLE_PINHOLE", "SIMPLE_RADIAL"])--visualize
: Flag to visualize the sparse reconstruction
Usage Example:
python scripts/run_cmd_colmap_rig_sfm.py \ --image_path inputs/images \ --rig_config configs/rig.json \ --camera_config configs/camera.json \ --output_path outputs/sfm \ --visualize # eg. python scripts/run_cmd_colmap_rig_sfm.py \ --image_path outputs/20250602xxxxxx/pinhole_images/images \ --rig_config outputs/20250602xxxxxx/pinhole_images/rig.json \ --camera_config outputs/20250602xxxxxx/pinhole_images/camera.json \ --output_path outputs/20250602xxxxxx/sfm \ --visualize
-
run_pycolmap_rig_sfm.py Runs the SfM pipeline using pycolmap with rig support.
Usage:
python scripts/run_pycolmap_rig_sfm.py [options]
Modify src/omni_processor.py
for pipeline configuration options.
The project includes a ComfyUI implementation for panoramic video processing and reconstruction with these features:
- Panoramic video loading (equirectangular and cubemap formats)
- Virtual pinhole camera generation from panoramic frames
- Panoramic-specific reconstruction parameters
- Interactive 360° preview capabilities
- Install ComfyUI (if not already installed):
git clone https://github.com/comfyanonymous/ComfyUI
cd ComfyUI
pip install -r requirements.txt
- Copy our nodes to ComfyUI's custom_nodes folder:
mkdir /path/to/ComfyUI/custom_nodes/omni-sfm
cp -r /path/to/omni-sfm/src/* /path/to/ComfyUI/custom_nodes/omni-sfm/
- Install required dependencies:
pip install -r /path/to/omni-sfm/requirements.txt
- Start ComfyUI:
python main.py
- In the web interface (http://localhost:8188):
- Right-click to open node menu
- Search for "Omni" to find our nodes
- Connect them as shown below:
[OmniVideoLoader] → [OmniParameterControls] → [OmniVideoProcessor]
↓
[OmniPreview] ← [OmniReconstruction]
- Example workflow:
- Load panoramic video with OmniVideoLoader
- Set parameters with OmniParameterControls
- Process video with OmniVideoProcessor
- View results with OmniPreview
- Run reconstruction with OmniReconstruction
- Fork the repository
- Create a feature branch
- Submit a pull request