GithubHelp home page GithubHelp logo

mondrian_factory's Introduction

IP4EC
Part of an internship at the Image processing for enhanced cinematography research group.

This README aims to explain how to use the code (Quickstart), then how it works.

Quickstart

Installation

  • If you have set up the whole Mondrians project (only available for UPF - IP4EC members), you could go to Use.

Modules

Clone this remote and personalized_tools, that you may store in the same directory.

git clone [email protected]:tourfl/mondrian_factory.git  
git clone [email protected]:tourfl/personalized_tools.git

Toolboxes

Then you clone the HDR Toolbox, on your local Matlab folder (assuming this is ~/Documents/MATLAB/), with the following command:

git clone https://github.com/banterle/HDR_Toolbox.git ~/Documents/MATLAB/HDR_Toolbox

Pathes

Next, you copy the startup.m file (:warning: it assumes you have put the two repositories in your Matlab folder) to your Matlab folder. It will automaticaly add the good folders to your Matlab path.

It is now installed! 🐫

Use

All you need to modify is the main.m file. The parameters are the following:

  • space: RGB, LMS or HDR
  • shape: Land
  • solution: 1 to 5
  • figs_on: true or false
  • save_on: true or false

The output images are stored at ../images/ (same level as mondrian_factory/).

Mondrian

Explanations

For more theoretical explanations, see the experimental report. This is only about how the code is working.

Required modules & toolboxes

  • personalized_tools: shared classes and superclasses (e.g. MondrianHandler)
  • HDR_Toolbox: I/O on PFM images, required for using PFM images

Folders

  • data: mainly .mat files with color matching functions, shape description, munsell colors reflectances, illuminants powerness

Parameters

Space

Mainly refers to color space. For LMS, the cones fundamentals are used, and for RGB, an RGB color matching function. The data are from the Colour & Vision database from the University College of London. Concerning the HDR space this is the same color matching function as RGB but the images are saved as PFM images. This file format allow to work with RGB values that are out of the [0 1] range. Yet, this is mainly used because an algorithm (private) requires PFM as input.

Shape

Currently there is only one shape available, this is the one from Land and McCann's experiment. You could build another shape (with the same number of areas), following the model of the existing one (data/shape/Landshape.mat, modify the italic part).

Illumination

trying to emulate Land's illuminations, 5 attempts are available:

  • To have best RGB white
  • Land’s XYZ
  • All Land’s illuminants powerness
  • One of Land’s illuminants powerness
  • D65 values

Experiments

According to Land's paper, there are 5 experiments: gray, red, green, blue, yellow. Those correspond to the actual color that is rendered as gray thanks to the illumination.

Outputs

The output images would be stored in the images/ folder, at the same level as mondrian_factory/.

..  
β”œβ”€β”€ images  
β”‚Β Β  β”œβ”€β”€ HDR  
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ solution1  
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ blueexp_s1_HDR.pfm  
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ blueexp_s1_HDR_percepted.pfm  
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ grayexp_s1_HDR.pfm  
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ grayexp_s1_HDR_percepted.pfm  
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ greenexp_s1_HDR.pfm  
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ greenexp_s1_HDR_percepted.pfm  
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ redexp_s1_HDR.pfm  
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ redexp_s1_HDR_percepted.pfm  
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ yellowexp_s1_HDR.pfm  
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── yellowexp_s1_HDR_percepted.pfm  
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ solution2  
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ ...  
β”‚Β Β  β”œβ”€β”€ LMS  
β”‚Β Β  └── RGB  
β”œβ”€β”€ mondrian_factory  
└── personalized_tools  

For each experiment (blue, red,...), there is an experimental and a perceptual version, according to McCann's paper. The two versions are built in the following way:

  • experimental: actual color labels & experimental illumination
  • perceptual: perceptual color labels & white illumination

the color labels and illuminations, are from McCann's.

Coding design

This is Matlab code in an object-oriented fashion. See the UML class diagram below.

UML Class Diagram

mondrian_factory's People

Contributors

tourfl avatar

Watchers

 avatar

mondrian_factory's Issues

Illuminations

Problems with illuminations are one of the actual causes of bad result.
Currently, I try to keep illuminations so that the highest value of the image is 1 in LMS.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.