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.
- Title: Combined Model Color-Correction Method Utilizing External Low-Frequency Reference Signals for Large-Scale Optical Satellite Image Mosaics
- IEEE Xplore: https://ieeexplore.ieee.org/document/9193955
- DOI: https://doi.org/10.1109/TGRS.2020.3018591
- Publication: IEEE Transactions on Geoscience and Remote Sensing, Vol. 59, No. 6, pp. 4993-5007, June 2021
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:
- Load warped images, image masks, and overlap masks.
- Estimate atmospheric-light related components and generate downsampled/enhanced images.
- Use low-frequency replacement and masked histogram matching for pairwise color correction.
- Apply the correction back to the source image resolution.
| Original mosaic | CMCC result |
|---|---|
![]() |
![]() |
- Windows
- Visual Studio 2022 with MSVC v143
- C++17
- OpenCV 4.7.0 for the default
Release|x64configuration
The project also contains an OpenCV 4.8.1 property sheet, but Release|x64 currently imports CMCC/OpenCV_4.7.0_relaese.props.
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.
From a Visual Studio Developer Command Prompt or Developer PowerShell:
msbuild CMCC.sln /p:Configuration=Release /p:Platform=x64Alternatively, open CMCC.sln in Visual Studio and build the Release|x64 configuration.
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.
After building, run the generated executable:
.\x64\Release\CMCC.exeFor each processed image set, corrected outputs are written to:
<dataset-root>/<image-set>/CMCC/
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 forRelease|x64.
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.

