Skip to content
Codes for contrast enhancement via Wilson-Cowan and Local Histogram Equalization
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Codes for contrast enhancement via Wilson-Cowan and Local Histogram Equalization

How to reproduce the experiments of the paper

From inside the experiments folder, it suffices to run the following command

julia experiments.jl


To install, clone this repository via

git clone

In order to import the package, do as usual

import Pkg

using WCvsLHE

The only exported functions are wc (implementing the WC contrast enhancement) and lhe (for the Local Histogram Equalization). There is a special type to store parameters, Params, which should be used to call both these functions. It is defined as follows:

struct Params
    σμ :: Float64 # std deviation of local mean average
    σw :: Float64 # std deviation of interaction kernel
    λ :: Float64 # attachment to the data
    M :: Float64 # the interaction weight is ν=1/(2M)

The functions wc and lhe take the following parameters:

  • I0: Input image
  • p: Parameters

Moreover, they have the following keyword arguments:

  • model: Can be either :planar for the non-oriented version or :cortical for the oriented one (defaults to :planar)
  • θs: Number of orientations to consider in case of a :cortical algorithm (defaults to 30)
  • α: Sigmoid parameter, used only in wc (defaults at 5)
  • verbose: If true the algorithm returns a Result instance, which saves the result, the number of iterations, and the relative tolerance attained. If false we only return the final image. (Defaults at false)
  • max_iter: Maximal number of iterations.
  • tolerance: Tolerance at which to stop.


using Images
img = load("myimage.png")

p = Params(2, 5, .7, .7)

wc(img, p, algo_type = :planar)
lhe(img, p, algo_type = :planar)
wc(img, p, algo_type = :cortical)
lhe(img, p, algo_type = :cortical)
You can’t perform that action at this time.