A simple pinhole camera library in Python.
Pincam computes a camera projection matrix that projects 3D geometries onto a defined camera image plane. It incorporates a simple raycasting method to resolve depth order for geometries relative to the image plane. The geometries are stored in a geopandas DataFrame, which facilitates easy plotting and customization of the geometries for further visualization and analysis.
For example, here's a radiation analysis visualized with Pincam for one of my projects (DeepRad, a deep learning framework for building radiation prediction). The initial rows illustrates input geometries, and the final row illustrates the surface simulation results.
An example project showing the visualization of three surfaces with a heading and pitch of 15 degrees, and focal length of 25 mm:
Using Pincam to show how camera projection works, here we see how 3D geometries are scaled by depth within the camera view frustum:
These examples can be seen in the quickstart.ipynb and view_frustrum.ipynb notebooks, in the notebooks directory.
- Separate out Pincam class into matrix module, and Pincam class.
- Seperate out Raycast, and Render modules. X3. Get rid of OpenCV dependency.
- Get rid of Ladybug-geometry dependency and replace with meshing algorithm.
- Rewrite raycasting library to use parallelized monte-carlo sampling.
- Python package
- Notebook of examples