hangong / ch

Demostration of color homography theorem with experiments in color correction, color feature matching, and color indexing, published in TPAMI 2017.
MIT License
7 stars 1 forks source link

Color Homography Theorem

Demostration of color homography Theorem with experiments in color correction, color feature matching, and color indexing, published in TPAMI 2019.

Images of co-planar points in 3-dimensional space taken from different camera positions are a homography apart. Homographies are at the heart of geometric methods in computer vision and are used in geometric camera calibration, 3D reconstruction, stereo vision and image mosaicking among other tasks. In this paper we show the surprising result that homographies are the apposite tool for relating image colors of the same scene when the capture conditions ‒ illumination color, shading and device ‒ change.

[Paper] [Supplementary Material]

References

Please cite the following papers if you find the code useful.

  1. Finlayson, G.D., Gong, H. (Co-first author) and Fisher, R., 2019. Color Homography: theory and applications. IEEE Transactions on Pattern Analysis and Machine Intelligence.
  2. Finlayson, G.D., Gong, H. and Fisher, R., 2016. Color Homography Color Correction, Color and Imaging Conference.
  3. Gong, H. and Finlayson, G.D., 2017. Root-Polynomial Color Homography Color Correction, AIC Congress.

Setup

The code was tested on Ubuntu 16.04 with MATLAB 2016b.

Download datasets

  1. Download files

  2. Make a directory named 'data' and extract the above packages to the 'data' dir. We will have the following structures:

    ./data/HG_HG_ColourChecker
    ./data/aloi/col/
    ./data/aloi/ill/
    ./data/aloi/view/

    We need to rename some extracted directories. For instance, the extracted 'aloi_col' directory becomes a sub-directory './data/aloi/col/'.

    Compile ASIFT

    $ cd ./homo_sim/ASIFT
    $ make

Color structure matching

Features of chromaticity histogram can be used for estimating a color homography which does a color mapping.

Color structure matching by ASIFT

see ./homo_sim/H_test.m which reproduces Fig.3 of the paper.

Color indexing test

We implemented 3 other color indexing methods:

The color homography color indexing is implemented in ./homo_sim/homo_index.m. They share the similar interface. For example, to get the result for swain's indexing method:

>> MP = swain_index('aloi/col');

where aloi/col is the color temperature test directory, MP's rows refer to object ID and its columns refer to capture condition. See the ALOI dataset website for the details.

Color Correction

Given pixel-to-pixel correspondances, color homography is applied for shading-invariant color mapping.

Shading invariant color mapping

see ./homo_sim/dismatch_im.m which reproduces Fig.5 of the paper.

Color correction test

We implemented 3 other color correction methods:

We also show 2 color homography approaches:

Please note that the results here are slightly different from the paper's due to a preivous evaluation bug. However, the relative difference is still similar.

To evaluate for all methods, in MATLAB execute

>> cal_real

Copyright 2018 Han Gong gong@fedoraproject.org, University of East Anglia.