Skip to content

aboucaud/face_lensing

Repository files navigation

Face Lensing

License Python supported versions PyPI PyPI downloads

Look at yourself through a gravitational lens

Face Lensing screenshot example

This program was developed for outreach purposes.

It deforms the input feed of a webcam as if the light had gone through a gravitational lens.
While the shape of the lens was precomputed and cannot be changed, one can play with the intensity of the deformation (using + / - keys) to make interesting effects appear.

The effect is best seen from a certain distance, when the head is well centered with respect to the webcam, but appears on the screen in multiple places around the image center.

Feel free to install and play with it, it has been tested on Windows, Linux and macOS.

Installation

  1. Install the Python program with pip
    pip install face-lensing
  2. Launch the app from a terminal
    face-lensing-app
  3. A program should appear with the distorted webcam image

App controls

The program can be controlled with a keyboard using the following keys

Key Action
h show/hide command helper
q quit the program
c change camera (in case of multiple webcams)
+/- increase/decrease the lensing effect
i, j, k, l move the lens respectively in the , , , directions
r reset the lens position and strength
Space save a screenshot locally

Acknowledgements

The original idea and precomputation of the lens deformation is attributed to Johan Richard (CRAL, CNRS/INSU)

License

This program is licensed under the MIT license.