Your face through a gravitational lens
Project description
Face Lensing
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.
Installation
- Install the Python program with
pippip install face-lensing
- Launch the app from a terminal
face-lensing-app
- 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.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file face_lensing-0.5.tar.gz.
File metadata
- Download URL: face_lensing-0.5.tar.gz
- Upload date:
- Size: 10.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d735fed791c4f728a97dcc35086fb6efef7b44a7747d75378409f61219352841
|
|
| MD5 |
21b3296fc663af665a2564f4b26252cd
|
|
| BLAKE2b-256 |
859779f6570ac2b3ee0299e0b636f85e1c5f9a4d475883ffa11ecebe5cb5000b
|
File details
Details for the file face_lensing-0.5-py2.py3-none-any.whl.
File metadata
- Download URL: face_lensing-0.5-py2.py3-none-any.whl
- Upload date:
- Size: 10.1 MB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2766885baad0dfc04a099abcc1812844a7af689bf41ca4a309d1b58ecd6d4357
|
|
| MD5 |
ad355fab3e3a191c673f10682cbd47af
|
|
| BLAKE2b-256 |
ae95b1e60764dc42c5d922dcd5924ad4047524cfabcb2ca0c33061570619529b
|