Skip to content

KESHAV-26-2004/Advanced-ISP-Pipeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“· Advanced Camera ISP Pipeline

End-to-End RAW Image Processing Pipeline with Research-Grade ISP Components

Python OpenCV NumPy RAW ISP Research


πŸ“– Project Overview

The Advanced Camera ISP Pipeline is a complete RAW image processing system that converts Bayer sensor RAW data into visually enhanced final RGB images.

This project recreates the major stages used inside real smartphone and DSLR camera pipelines.

The system processes .dng / RAW images through multiple ISP stages including:

  • RAW linearization
  • Dead Pixel Correction
  • Lens Shading Correction
  • Advanced Demosaicing
  • White Balance
  • Color Correction Matrix (CCM)
  • Exposure Correction
  • Gamma Rendering
  • Adaptive Final Rendering

Goal: Design and implement a complete software-based camera ISP pipeline from scratch using image science and research methods.


πŸ“· Data Acquisition

πŸ“± Smartphone RAW Capture

RAW images were captured using the Open Camera application:

πŸ‘‰ https://play.google.com/store/apps/details?id=net.sourceforge.opencamera

Features used:

  • RAW (DNG) capture enabled
  • Manual exposure control
  • Auto white balance disabled (for ISP evaluation)

Device: Samsung Galaxy S24 Ultra


πŸ“Έ DSLR RAW Dataset

DSLR RAW images were sourced from the MIT-Adobe FiveK Dataset:

πŸ‘‰ https://data.csail.mit.edu/graphics/fivek/


βš™οΈ ISP Pipeline Architecture


✨ Core Features

πŸ”Ή 1. RAW Linearization

  • Reads Bayer RAW .dng
  • Per-channel black level subtraction
  • White level normalization
  • CFA pattern detection

Supported Bayer patterns:

  • RGGB
  • BGGR
  • GBRG
  • GRBG

πŸ”Ή 2. Dead Pixel Correction

Smart CFA-aware hot/dead pixel removal using same-color neighborhood analysis.

Features:

  • Hot pixel correction
  • Dead pixel correction
  • Highlight protection
  • Adaptive thresholds

πŸ”Ή 3. Lens Shading Correction

Corrects corner vignetting and sensor brightness falloff.

Features:

  • Radial gain compensation
  • Adaptive corner brightening

πŸ”Ή 4. Advanced Demosaicing

Implemented multiple demosaicing algorithms:

  • Bilinear
  • OpenCV Edge Aware
  • Malvar-He-Cutler (MHC)
  • Hamilton-Adams
  • Menon
  • ARI
  • CNN-based Demosaic

πŸ”Ή 5. White Balance Research Lab

Multiple white balance algorithms:

  • Camera Metadata WB
  • Gray World
  • Shades of Gray
  • Grey Edge
  • White Patch
  • Gamut Mapping
  • Bayesian WB

πŸ”Ή 6. Color Correction Matrix (CCM)

Transforms sensor RGB into display color space.

Includes:

  • Adaptive CCM
  • Warm CCM
  • Cool CCM
  • Neutral CCM

πŸ”Ή 7. Exposure Engine

Scene brightness correction:

  • Global Gain
  • Mean Target
  • Percentile Exposure
  • Highlight Safe Exposure
  • Adaptive Exposure
  • Shadow Lift

πŸ”Ή 8. Gamma / Tone Mapping

Implemented rendering curves:

  • Gamma 2.2
  • Gamma 2.4
  • sRGB Gamma
  • BT.709
  • Adaptive Gamma
  • Filmic Curve

πŸ”Ή 9. Adaptive Final Renderer

Final aesthetic stage:

  • Scene-aware brightness
  • Vibrance
  • Saturation
  • Contrast
  • Black Point
  • Warmth control
  • Orientation correction

πŸ–ΌοΈ Final Results

πŸ“Έ DSLR Pipeline Output


πŸ“± Samsung S24 Ultra RAW Pipeline


πŸ” Comparison Insight

  • DSLR pipeline tuned for natural tones and controlled contrast
  • Smartphone pipeline optimized for vibrant colors and dynamic scenes
  • Custom rendering outperforms default RAW processing in highlight handling

πŸ“Š Highlights

  • Better highlight preservation in bright skies
  • Full custom RAW pipeline from scratch
  • Modular ISP architecture
  • Multiple research algorithms per stage
  • Real camera imaging science implementation

πŸ“‚ Project Structure

Project/
β”‚
β”œβ”€β”€ Core/
β”‚   β”œβ”€β”€ methods/
β”‚   β”œβ”€β”€ calibration/
β”‚   β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ models/
β”‚   └── notebooks/
β”‚
β”œβ”€β”€ run_phone_pipeline.ipynb
β”œβ”€β”€ run_dslr_pipeline.ipynb
β”‚
β”œβ”€β”€ README.md
└── .gitignore

πŸš€ Run Project

Install Dependencies

pip install -r requirements.txt

Run Notebook

jupyter notebook

Open:

run_phone_pipeline.ipynb  
run_dslr_pipeline.ipynb

πŸ”¬ Future Improvements

  • AI Auto White Balance
  • AI Demosaicing
  • Noise Reduction
  • Sharpening Engine
  • HDR Merge
  • Portrait Skin Tuning
  • Real-time Mobile ISP

πŸ‘¨β€πŸ’» Author

Keshav B.Tech CSE Bennett University


⭐ Support

If you like this project, give it a star ⭐ on GitHub.

About

Research-grade Image Signal Processing pipeline for RAW Bayer to RGB conversion using advanced demosaicing, white balance, color correction, exposure tuning, and rendering methods.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors