JuliaImages / ImageContrastAdjustment.jl

A Julia package for enhancing and manipulating image contrast.
MIT License
11 stars 5 forks source link

Precompute lookup for N0f8 #55

Closed timholy closed 3 years ago

timholy commented 3 years ago

transform_density! is the main bottleneck for histogram equalization. When the number of possible values in the image is modest, it makes sense to precompute the entire lookup table and then apply it.

codecov[bot] commented 3 years ago

Codecov Report

Merging #55 (114d9b9) into master (d545b4e) will increase coverage by 0.04%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #55      +/-   ##
==========================================
+ Coverage   95.89%   95.94%   +0.04%     
==========================================
  Files          12       12              
  Lines         585      592       +7     
==========================================
+ Hits          561      568       +7     
  Misses         24       24              
Impacted Files Coverage Δ
src/algorithms/common.jl 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update d545b4e...114d9b9. Read the comment docs.

timholy commented 3 years ago

Performancewise, this eliminates the gap between us and OpenCV in the "histeq" benchmark of https://github.com/JuliaImages/image_benchmarks, except at the two largest image sizes (where I suspect OpenCV switches to a multithreaded algorithm).

timholy commented 3 years ago

Maybe get a release soon? I'm not sure whether you want to merge some of the other changes first.

zygmuntszpak commented 3 years ago

I was initially planning to incorporate the PiecewiseLinearStretching stuff, but may as well release your performance improvements first.

zygmuntszpak commented 3 years ago

@JuliaRegistrator register

JuliaRegistrator commented 3 years ago

Comments on pull requests will not trigger Registrator, as it is disabled. Please try commenting on a commit or issue.