This repo provide a python script to create a composite image from a video.
pip install opencv-python
python composite_image.py --video_path=./example_video.mp4 --start_t=0.0 --end_t=99.0 --skip_frame=2 --mode=VAR
python composite_image.py --video_path=./example_video.mp4 --start_t=0.0 --end_t=99.0 --skip_frame=2 --mode=MIN
python composite_image.py --video_path=./example_video.mp4 --start_t=0.0 --end_t=99.0 --skip_frame=2 --mode=MAX
- --video_path: The path of the input video.
- --start_t: the start time of the composite image.
- --end_t: the end time of the composite image.
- --skip_frame: skip frame number when extracting frames, input
1
for not skipping any frame. - --mode: mode of image merging, three choices is implemented:
- VAR (Recommend): Use the pixel that is furthest from the mean of the image
- MAX: Keep the lightest pixel.
- MIN: Keep the darkest.