Skip to content
/ WCvsLHE Public

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

License

Notifications You must be signed in to change notification settings

dprn/WCvsLHE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Usage

To install, clone this repository via

git clone https://github.com/dprn/WCvsLHE.git

In order to import the package, do as usual

import Pkg
Pkg.activate(path_to_WCvsLHE_folder)

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)
end

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.

Example

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)

About

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

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages