Look at yourself through a gravitational lens
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.
- Install the Python program with
pip
pip install face-lensing
- Launch the app from a terminal
face-lensing-app
- A program should appear with the distorted webcam image
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 |
The original idea and precomputation of the lens deformation is attributed to Johan Richard (CRAL, CNRS/INSU)
This program is licensed under the MIT license.