For a simple case using opencv
's solvePnP
algorithm.
- Create a Python virtual environment.
For example to use
conda
to create an environment called3d-reconstruction
:conda create -n 3d-reconstruction python=3.10
- Activate the virtual environment.
With conda:
conda activate 3d-reconstruction
- Install the dependencies specified in the
requirements.txt
file with:pip install -r requirements.txt
- You should be able to run the
compute_camera_extrinsics.ipynb
notebook in the created virtual environment 🎉
Multi-view triangulation:
- https://github.com/strawlab/pymvg/tree/master
- Gist to triangulate a point seen in n views
- This pycalib repo is educational but probably a good starting point.
- Here they have the function to triangulate an array of points given their 2D coordinates in two or more views
Bundle adjustment:
- What is the difference with triangulation?
- This scipy tutorial seems useful.
- From the pycalib repo: this tutorial seems good.
Triangulate points -- opencv example
- only 2-by-2 views are possible in opencv's Python API
- see examples here