Skip to content

neelabhz/Video_change

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Video Change Detection & Chromatic Effects

Python tools for video change detection and chromatic motion effects.

What's Inside

video_change_detector.py - Detect changes between frames
video_chromatic_motion.py - Create chromatic effects on video

Installation

pip install -r requirements.txt

Quick Start

Change Detection (Black & White)

python video_change_detector.py input.mp4

Rainbow Motion Effect (Motion in color, rest B&W)

python video_chromatic_motion.py selective-color input.mp4

Full RGB Time-Shift Effect

python video_chromatic_motion.py rgb-shift input.mp4

video_change_detector.py

Detects what changed in video over time.

Basic:

python video_change_detector.py video.mp4

With options:

python video_change_detector.py video.mp4 -t 1.0 --threshold 30 --intensity 1.0 --mode grayscale

Arguments:

  • -t 1.0 - Time offset in seconds (larger = ignore slow camera movement)
  • --threshold 30 - Sensitivity 0-255 (lower = more sensitive)
  • --intensity 1.0 - Brightness 0-2 (higher = brighter)
  • --mode grayscale - Output mode: grayscale or colormap
  • -o output.mp4 - Custom output file

To reduce camera movement detection: Use larger -t value (e.g., -t 2.0 or -t 3.0)

video_chromatic_motion.py

Four modes for chromatic effects:

1. selective-color - Rainbow motion, B&W static (RECOMMENDED)

Basic:

python video_chromatic_motion.py selective-color video.mp4

With custom RGB offsets:

python video_chromatic_motion.py selective-color video.mp4 \
  --red-offset 0.3 --green-offset 0.7 --blue-offset 1.0 --threshold 25

Arguments:

  • --red-offset 0.3 - Red channel time (seconds)
  • --green-offset 0.7 - Green channel time (seconds)
  • --blue-offset 1.0 - Blue channel time (seconds)
  • --motion-offset 2.0 - Motion detection time offset (seconds, larger = ignore camera movement)
  • --threshold 25 - Motion sensitivity 0-255 (lower = more sensitive)
  • -o output.mp4 - Custom output file

To reduce camera movement detection: Add --motion-offset 2.0 or higher (e.g., --motion-offset 3.0)

2. rgb-shift - Full video chromatic effect

python video_chromatic_motion.py rgb-shift video.mp4

3. motion-diff - Multi-speed motion visualization

python video_chromatic_motion.py motion-diff video.mp4

4. motion-color - Single color motion on black

python video_chromatic_motion.py motion-color video.mp4 -t 1.0 -c cyan

Arguments:

  • -t 1.0 - Time offset in seconds (larger = ignore camera movement)
  • -c cyan - Color: red, green, blue, cyan, magenta, yellow, white, orange, purple, pink, lime, teal
  • --threshold 30 - Sensitivity
  • --intensity 1.0 - Brightness

Tips

Avoiding camera movement detection:

  • Both tools detect ALL motion, including camera movement
  • Use larger time offsets to ignore slow camera pans/zooms
  • Example: -t 2.0 or -t 3.0 for change detector
  • Example: --red-offset 0.5 --green-offset 1.5 --blue-offset 2.5 for chromatic

Adjusting sensitivity:

  • Lower --threshold = more sensitive (detects small changes)
  • Higher --threshold = less sensitive (only major changes)
  • Default is 30, try 20-40 range

Examples

Subtle rainbow trails:

python video_chromatic_motion.py selective-color video.mp4 \
  --red-offset 0 --green-offset 0.2 --blue-offset 0.4

Dramatic chromatic (ignores camera movement):

python video_chromatic_motion.py selective-color video.mp4 \
  --red-offset 0.5 --green-offset 1.5 --blue-offset 2.5 --motion-offset 2.5 --threshold 35

Change detection (high contrast, ignores camera):

python video_change_detector.py video.mp4 -t 2.0 --threshold 35 --intensity 2.0

Requirements

  • Python 3.7+
  • opencv-python
  • numpy

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages