Skip to content

Gway0521/DIP-Term-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Image Processing Pipeline (Modular)

Pipeline to denoise camera images/videos with swappable stages. All code lives in Code/, inputs in Image/ and Video/, outputs in Result/.

Usage

  • Activate env: C:\Users\IvaneChen\anaconda3\envs\image_processing_hw1\python.exe.
  • Run default (Fast NLM color): python Code/main.py.
  • Choose method: python Code/main.py --denoise-method fast_nlm_gray or --denoise-method bilateral.
  • Optional flags: --resize-max-side 960 (speed), --image-limit 5, --video-limit 1, --videos campus.mp4 WIN_20251128_03_47_51_Pro.mp4, --param h=12 hColor=10.
  • Skip groups: --skip-images or --skip-videos.
  • Use custom JSON config: python Code/main.py --config Code/sample_config.json.
  • Add sharpening: python Code/main.py --add-sharpen --sharpen-method laplacian_edge --sharpen-param alpha=0.4.
  • Add color/contrast: python Code/main.py --add-color --color-method clahe --color-mode day (or --color-mode night / --color-auto).
  • Add tone mapping: python Code/main.py --add-tonemap --tone-method reinhard --tone-mode day (night or --tone-auto also supported).
  • Add frame interpolation (video only): python Code/main.py --add-frame-interp --frame-interp-method dis_optical_flow (defaults to a fast compensated blend).

Stages

  • denoise (methods: fast_nlm_color, fast_nlm_gray, bilateral). Defaults live in Code/stages/denoise.py and can be overridden with --param key=value.
  • sharpen (methods: unsharp, laplacian_edge). Append with --add-sharpen --sharpen-method unsharp and tweak with --sharpen-param key=value (defaults in Code/stages/sharpen.py).
  • color (methods: clahe, white_balance, gamma) with day/night presets and optional auto-switching. Defaults in Code/stages/color.py; override with --color-param key=value.
  • tone (methods: reinhard, aces, sigmoid, drago if available) with day/night or auto mode. Defaults in Code/stages/tonemap.py; override with --tone-param key=value.
  • frame_interpolation (video-only; methods: compensated_blend, dis_optical_flow) inserts midpoint frames and doubles output FPS. Configure with --frame-interp-method and --frame-interp-param key=value.
  • undistort (lens calibration) loads camera_calib.npz and should run first to correct distortion; configure via stage params (alpha, calib_path, use_new_camera_matrix).
  • Architecture is stage-based (Stage in Code/stages/base.py) so new transforms can be added via build_stage in Code/pipeline.py.

Config file example (Code/sample_config.json)

{
  "resize_max_side": 960,
  "stages": [
    {"kind": "denoise", "params": {"method": "fast_nlm_color", "h": 10, "hColor": 10}}
  ]
}

Outputs

  • Images: Result/images/<name>_<pipeline_tag>.jpg
  • Videos: Result/videos/<name>_<pipeline_tag>.mp4 (keeps FPS, mp4v codec)

Logging

  • Logs show stages, params, file paths, and runtime per file. Add --verbose for debug logs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages