Skip to content

Repository files navigation

Depth Estimation Using Image Pre-Processing

Project Overview

This project improves monocular depth estimation performance by applying image pre-processing techniques like exposure correction and edge enhancement before feeding the images into deep learning models. We integrate:

LCDPNet for exposure correction

SG-WLS filtering for edge enhancement (manually via MATLAB)

Marigold and Depth Anything V2 models for depth estimation

Standard evaluation metrics for performance comparison.

Key Features

Automatic download and extraction of NYU-Depth V2 dataset.

Image pre-processing using LCDPNet.

Edge enhancement using SG-WLS manually via MATLAB.

Depth map prediction using Marigold and Depth Anything V2.

Evaluation based on RMSE, MAE, AbsRel, and SSIM.

Fully automated Python pipeline for all steps (except MATLAB).

Project Structure

depth_estimation_with_preprocessing/ │ ├── dataset/ # Extracted RGB images and depth maps ├── results/ # Preprocessed images, depth predictions │ ├── LCDPNet/ # LCDPNet exposure correction repo ├── Marigold/ # Marigold depth estimation repo ├── Depth-Anything-V2/ # Depth Anything V2 model repo ├── Semi-Global-Weighted-Least-Squares-in-Image-Filtering/ # SG-WLS MATLAB repo │ ├── download_and_extract_dataset.py # Downloads and extracts NYU dataset ├── full_pipeline.py # Master script (glues all steps) ├── Evaluating_model.py # Evaluates predicted depth maps │ ├── requirements.txt # Python dependencies └── README.md # This file

Installation

Clone the repository

git clone https://github.com/Palash-7/depth_estimation_with_preprocessing.git cd depth_estimation_with_preprocessing

Install Python dependencies

pip install -r requirements.txt

Run the full pipeline

python full_pipeline.py Pipeline stages explained:

Step 1: Download NYU-Depth V2 dataset

Step 2: Apply LCDPNet exposure correction

Step 3: Manual Step — apply SG-WLS edge enhancement using MATLAB (script: SG_WLS.m)

Step 4: Predict depth maps using Marigold and Depth Anything V2

Step 5: Evaluate predicted depth maps against ground truth (metrics printed)

Evaluation Metrics

Metric Description RMSE Root Mean Square Error MAE Mean Absolute Error Abs Rel Absolute Relative Error SSIM Structural Similarity Index Measure Better models will show:

Lower RMSE, MAE, Abs Rel

Higher SSIM

Sample Output

Model RMSE ↓ MAE ↓ Abs Rel ↓ SSIM ↑ Marigold (Original Input) 0.72 0.45 0.18 0.78 Marigold (After Preprocessing) 0.65 0.39 0.15 0.83 Depth Anything V2 (Original Input) 0.68 0.42 0.16 0.80 Depth Anything V2 (After Preprocessing) 0.62 0.36 0.14 0.85

Real-World Applications Autonomous Driving: Safer vehicle navigation

Robotics: Enhanced 3D environment understanding

AR/VR: Realistic virtual scenes

Medical Imaging: Accurate 3D reconstructions from 2D scans

Summary

This project shows that applying targeted image pre-processing significantly improves the accuracy of monocular depth estimation models. It highlights how even simple preprocessing steps like exposure correction and edge enhancement can lead to measurable gains without modifying the model architecture.

Important Notes

MATLAB Required: You need MATLAB installed for SG-WLS filtering.

Weights Download: Ensure you download the pre-trained weights for Marigold and Depth Anything V2 if needed.

Manual Step: Manual SG-WLS filtering is required between Steps 2 and 4.

About

Monocular Depth Estimation Improved Using Image Pre-processing Techniques (LCDPNet, SG-WLS)

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages