Skip to content

timothy-a13/CMCC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[Paper Implementation] CMCC

English | 中文

CMCC is a C++/OpenCV implementation of a color-correction workflow for optical satellite image mosaics. The implementation follows the method described in the IEEE paper below and processes pre-aligned mosaic images with image masks and overlap masks.

Paper

What This Code Does

The program iterates through a dataset root folder, loads each image set, and writes corrected mosaic images into a CMCC output folder under each set. The main steps are:

  1. Load warped images, image masks, and overlap masks.
  2. Estimate atmospheric-light related components and generate downsampled/enhanced images.
  3. Use low-frequency replacement and masked histogram matching for pairwise color correction.
  4. Apply the correction back to the source image resolution.

Example Result

Original mosaic CMCC result
Original mosaic CMCC result

Requirements

  • Windows
  • Visual Studio 2022 with MSVC v143
  • C++17
  • OpenCV 4.7.0 for the default Release|x64 configuration

The project also contains an OpenCV 4.8.1 property sheet, but Release|x64 currently imports CMCC/OpenCV_4.7.0_relaese.props.

OpenCV Setup

The default OpenCV property sheet expects OpenCV 4.7.0 at:

C:\Libraries\opencv-4.7.0_win\opencv\build\include
C:\Libraries\opencv-4.7.0_win\opencv\build\x64\vc16\lib

and links against:

opencv_world470.lib

If OpenCV is installed somewhere else, update CMCC/OpenCV_4.7.0_relaese.props or replace the imported property sheet in Visual Studio.

At runtime, make sure opencv_world470.dll can be found, either by adding the OpenCV binary directory to PATH or by placing the DLL next to the built executable.

Build

From a Visual Studio Developer Command Prompt or Developer PowerShell:

msbuild CMCC.sln /p:Configuration=Release /p:Platform=x64

Alternatively, open CMCC.sln in Visual Studio and build the Release|x64 configuration.

Input Data Layout

CMCC/main.cpp currently uses this hard-coded dataset root:

std::string root = "E:\\Dataset\\FloodNet_dataset_d";

Change this path before running if your dataset is stored elsewhere.

Each subfolder under the dataset root is treated as one image set. The expected layout is:

<dataset-root>/
  <image-set>/
    multiview_warp_result/
      00__warped_img.png
      01__warped_img.png
      ...
    img_masks/
      mask_00.png
      mask_01.png
      ...
    overlap/
      00__01__overlap.png
      01__02__overlap.png
      ...

The overlap directory must exist. Individual overlap masks may be omitted; when a pair-specific overlap mask is not found, the code falls back to computing the overlap from the image masks.

Run

After building, run the generated executable:

.\x64\Release\CMCC.exe

For each processed image set, corrected outputs are written to:

<dataset-root>/<image-set>/CMCC/

Project Structure

  • CMCC/main.cpp: dataset iteration and end-to-end processing flow.
  • CMCC/ImageDataLoader.h: warped image, mask, and overlap-mask loading.
  • CMCC/SatelliteImageEnhancer.h: dark-channel, atmospheric-light, transmission-map, and enhancement steps.
  • CMCC/SimpleColorProcessor.h: low-frequency replacement and pairwise correction flow.
  • CMCC/ColorCorrection.h, CMCC/HM.h, CMCC/HMpp.h: color-correction and histogram-matching utilities.
  • CMCC/OpenCV_4.7.0_relaese.props: default OpenCV property sheet for Release|x64.

Copyright Notes

This repository is intended to contain an independent implementation of the paper method. It should not redistribute the IEEE paper PDF, extracted figures, tables, screenshots, or long verbatim passages from the paper unless permission is granted by the rights holder.

The README only provides bibliographic information and links to the IEEE Xplore page/DOI. Before uploading generated images, datasets, or evaluation CSV files, also verify the license or redistribution terms of the source dataset.

No project license file is currently included. If this repository is meant to be open source, add a LICENSE file before publishing so downstream users know how the implementation code may be used.

About

[Paper Implementation] C++/OpenCV implementation of Combined Model Color Correction (CMCC).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages