Skip to content

IPOL-Fork/retinex_pde

 
 

Repository files navigation

% Retinex PDE

# ABOUT

* Author    : Nicolas Limare <nicolas.limare@cmla.ens-cachan.fr>
              Jose-Luis Lisani <joseluis.lisani@uib.es>
* Copyright : (C) 2009-2011 IPOL Image Processing On Line http://www.ipol.im/
* License   : GPL v3+, see GPLv3.txt

# OVERVIEW

This source code provides an implementation of the Retinex theory by a
Poisson equation, as described in IPOL
    http://www.ipol.im/pub/algo/lmps_retinex_poisson_equation/.

This program reads a PNG image, computes its laplacian, performs a
DFT, then solves the Poisson equation in the Fourier space and
performs an inverse DFT.
The result is normalized to have the same mean and variance as the
input image and written as a PNG image.

# REQUIREMENTS

The code is written in ANSI C, and should compile on any system with
an ANSI C compiler.

The libpng header and libraries are required on the system for
compilation and execution. See http://www.libpng.org/pub/png/libpng.html

The fftw3 header and libraries are required on the system for
compilation and execution. See http://www.fftw.org/

# COMPILATION

Simply use the provided makefile, with the command `make`.

Alternatively, you can manually compile
    cc -DNDEBUG io_png.c norm.c retinex_pde_lib.c retinex_pde.c \
        -lpng -lfftw3f -o retinex_pde

Multi-threading is possible, with the FFTW_NTHREADS parameter:
    cc -DNDEBUG io_png.c norm.c retinex_pde_lib.c retinex_pde.c \
        -DFFTW_NTHREADS=4 -lpng -lfftw3f -lfftw3f_threads -o retinex_pde

Omit the -DNDEBUG option to get some debugging information when you
run the program.

# USAGE

This program takes 4 parameters: `retinex_pde T in.png rtnx.png`

* `T`        : retinex threshold, in [0,1[
* `in.png`   : input image
* `rtnx.png` : retinex output image

# ABOUT THIS FILE

Copyright 2009-2011 IPOL Image Processing On Line http://www.ipol.im/
Author: Nicolas Limare <nicolas.limare@cmla.ens-cachan.fr>

Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved.  This file is offered as-is,
without any warranty.