Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexflint/triangulation
High quality implementations of many triangulation algorithms in pure python.
https://github.com/alexflint/triangulation
Last synced: 22 days ago
JSON representation
High quality implementations of many triangulation algorithms in pure python.
- Host: GitHub
- URL: https://github.com/alexflint/triangulation
- Owner: alexflint
- Created: 2015-07-02T03:52:36.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-02T03:12:04.000Z (about 9 years ago)
- Last Synced: 2024-09-24T07:06:59.753Z (about 1 month ago)
- Language: Python
- Homepage:
- Size: 145 KB
- Stars: 33
- Watchers: 4
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Triangulation
[ ![Codeship Status for alexflint/triangulation](https://codeship.com/projects/a56819e0-05cc-0133-6af3-22315beb1c0d/status?branch=master)](https://codeship.com/projects/89535)
High quality implementations of triangulation algorithms in pure python.
### Installation
```bash
pip install triangulation
```### Usage
```python
from rigidbody import pr, rotation, SE3
from triangulation import triangulatenoise = 1e-3
true_point = np.random.randn(3) + [0, 0, 10]positions = np.random.randn(num_frames, 3)
orientations = map(rotation.exp, np.random.randn(num_frames, 3)*.1)
poses = [SE3(r, p) for r, p in zip(orientations, positions)]features = []
for pose in poses:
z = pr(np.dot(pose.orientation, point - pose.position))
features.append(z + np.random.randn(2) * noise)triangulated_point = triangulate(features, poses, algorithm="midpoint")
```### Algorithms
**`triangulate_midpoint`**
Finds the 3D point minimizing the sum of squared distances to the rays from each camera.
**`triangulate_linear`**
Finds the 3D point minimizing the sum of squared alebraic errors.
**`triangulate_directional`**
Finds the 3D point minimizing the squared directional error in the first view and the view with longest baseline to the first view.
**`triangulate_directional_pair`**
Finds the 3D point minimizing the squared directional error in two views.
**`triangulate_infnorm`**
Finds the 3D point minimizing the infinity norm of the vector of reprojection errors in all views.
**`triangulate_infnorm_fixed`**
Finds any 3D point such that all reprojection errors are no greater than a given threshold.