From inside the experiments folder, it suffices to run the following command
julia experiments.jlTo 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 WCvsLHEThe 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)
endThe functions wc and lhe take the following parameters:
I0: Input imagep: Parameters
Moreover, they have the following keyword arguments:
model: Can be either:planarfor the non-oriented version or:corticalfor the oriented one (defaults to:planar)θs: Number of orientations to consider in case of a:corticalalgorithm (defaults to 30)α: Sigmoid parameter, used only inwc(defaults at5)verbose: Iftruethe algorithm returns aResultinstance, which saves the result, the number of iterations, and the relative tolerance attained. Iffalsewe only return the final image. (Defaults atfalse)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)