Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/smidm/camera.py
Python module for projective camera model
https://github.com/smidm/camera.py
3d camera computer-vision geometry python
Last synced: 3 months ago
JSON representation
Python module for projective camera model
- Host: GitHub
- URL: https://github.com/smidm/camera.py
- Owner: smidm
- License: mit
- Created: 2014-08-06T12:51:30.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-12-22T08:10:02.000Z (about 8 years ago)
- Last Synced: 2023-03-22T20:48:16.832Z (almost 2 years ago)
- Topics: 3d, camera, computer-vision, geometry, python
- Language: Python
- Size: 2.94 MB
- Stars: 41
- Watchers: 1
- Forks: 23
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Python Projective Camera Model
==============================Features
--------
- camera intrinsic and extrinsic parameters handling
- various lens distortion models
- model persistence
- projection of camera coordinates to an image
- conversion of image coordinates on a plane to camera coordinates
- visibility handlingInstallation
------------
::pip install git+https://github.com/smidm/camera.py.git
Usage
-----Setup camera and project point [0, 0, 0]::
import camera
import numpy as np
import math
c = camera.Camera()
c.set_K_elements(1225.0, math.pi / 2, 1, 480, 384)
R = np.array(
[[-0.9316877145365, -0.3608289515885, 0.002545329627547],
[-0.1725273110187, 0.4247524018287, -0.8888909933995],
[0.3296724908378, -0.8263880720441, -0.4579894432589]])
c.set_R(R)
c.set_t(np.array([[-1.365061486465], [3.431608806127], [17.74182159488]]))
print c.world_to_image(np.array([[0., 0., 0.]]).T)
Load camera parameters from a file::import camera
import numpy as np
c = camera.Camera()
c.load('camera_01.yaml')
c.world_to_image(np.array([[0., 0., 0.]]).T)Documentation
-------------http://python-projective-camera-model.readthedocs.io
Development
-----------To test the package run::
$ ./run_tests.sh
The module is missing some (essential) functionality (search for TODO comments). I appreciate pull requests that fill the gaps.License
-------MIT