Contrast Limited Adaptive Histogram Equalization - Read more about Histogram Equalization here.
File: CLAHE-correction-plugin.py
This plugin applies the CLAHE algorithm to the scene video previewed in Pupil Player. See this documentation on how to install the plugin.
File: apply-clahe.py
This Player-independent script reads the scene video, applies the algorithm with a specific parameter set, and writes the result to a new video file. By following these steps, you can replace the original scene video with the post-processed one:
- Install the requirements (only required once)
pip install av opencv-python rich
- Stop Pupil Player (in case it is running)
- Rename
world.mp4
tobackup.mp4
- Run the script
python apply-clahe.py <path to recording folder> -cl 40 -gsr 8 -gsc 8
- The result will be written to
world.mp4
in the given recording folder - Use the
cl
,gsr
,gsc
options to set custom CLAHE parameters
- Delete the
world_lookup.npy
file - Open the recording in Pupil Player
General usage:
usage: apply-clahe.py [-h] [-cl CLIP_LIMIT] [-gsr TILE_GRID_SIZE_ROW] [-gsc TILE_GRID_SIZE_COL] [--in-file IN_FILE] [--out-file OUT_FILE] [--force]
recording
positional arguments:
recording
optional arguments:
-h, --help show this help message and exit
-cl CLIP_LIMIT, --clip-limit CLIP_LIMIT
-gsr TILE_GRID_SIZE_ROW, --tile-grid-size-row TILE_GRID_SIZE_ROW
-gsc TILE_GRID_SIZE_COL, --tile-grid-size-col TILE_GRID_SIZE_COL
--in-file IN_FILE
--out-file OUT_FILE
--force