Skip to main content

Photonbend allows one to convert photos between different sorts of lenses, rotate photos and make panoramas.

Project description

Photonbend

Photonbend is a python module to handle photos, especially photos taken with fisheye lenses, and convert them between different kinds of lenses, FoV, and types of photos like inscribed circles, cropped circles, or even side-by-side double inscribed circles. It also allows you to rotate those photos, convert them to equirectangular panoramas or convert panoramas to fisheye photos.

It can be used as a library to handle images on your projects or it can be used as a standalone tool with its own set of commands to help you alter your photos taken with a fisheye lens, an omnidirectional camera such as the Samsung Gear 360 or an equirectangular panorama.

If you just want to use the tools go to the Scripts. If you want to undestand how it works just keep reading

Concepts

Fisheye photography

Unlike rectilinear lenses, fisheye lenses can capture great angles like 180º and even greater. With the right setup we can nowadays produce 360º images.

Equidistant Projection (lens)
A 360º fisheye photo with its center aiming at the ceiling.1

Those type of images follow a scheme like the one below:

Inscribed image scheme
Fisheye photo scheme depicting the angles produced by an equidistant lens

How it works

This module uses the information you provide about the image format, lenses, and FoV, couples it with mathematical functions that describes the ways the lenses behave, and makes use of trigonometry to map your planar photos or panoramas to a sphere (actually, the interior wall of a sphere. Using a sphere as a base lets you rotate the image. Using all those functions and trigonometry, it also lets you take a virtual picture of the interior of the sphere using different sorts of lenses and FoV to produce new images. It also lets you map a sphere to an equirectangular panorama.

Image maps

You can see examples on the scripts page

Convention

On the case of the images this software was designed to handle, the convention we adopted was the the center of the image is the top of the sphere, and its borders are the maximum angle of the FoV (In case of a 360 degree image, the sphere's bottom). This convention is important to understand the rotation scheme.

Rotation

This tool lets you rotate your images. For reference, the rotation is defined in 3 degrees of freedom, namely: pitch, yaw and roll, and their direction of rotation are those shown in the image below:

Rotation
For reference, on the scheme above, we are visualizing the image sphere looking down from its top.

Scripts

The module installs a a script 3 different commands to help you deal with your images.

  1. About the source image used on the examples:

    Author: Bob Dass
    Title: View From The Deck
    Available at: https://flickr.com/photos/54144402@N03/50677156243/in/faves-195024173@N05/
    License: Creative Commons - Attribution 2.0
    License summary here
    License text here

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

photonbend-1.0.0.tar.gz (20.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

photonbend-1.0.0-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file photonbend-1.0.0.tar.gz.

File metadata

  • Download URL: photonbend-1.0.0.tar.gz
  • Upload date:
  • Size: 20.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.13 Linux/5.15.0-47-generic

File hashes

Hashes for photonbend-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e52078ba6ad1ed14ebc2d1556d3c9862232053fe2ebf4b167e97e366eaca6e0f
MD5 8f09cbe97ab9fa3aeb88837d0c414b18
BLAKE2b-256 d2263090162c6e70b92a2b507b6eb883b1ae4db8e285f5403f6547cbadd69617

See more details on using hashes here.

File details

Details for the file photonbend-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: photonbend-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.8.13 Linux/5.15.0-47-generic

File hashes

Hashes for photonbend-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c159155cddf3784d92e317df4a4fa11dc695f81fc8e97fe9b77df8648eda1c89
MD5 ae4b57f9316222027620c7cb2f2bdc9b
BLAKE2b-256 1bb5936f795273f8b9e07dba23b618022143a8962b0e8cd1bcbfd7c88faa791f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page