JuliaImages / ImageContrastAdjustment.jl

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

More optimizations #53

Closed timholy closed 3 years ago

timholy commented 3 years ago

17 made steps to improve performance, but there was still more that could be done:

The aggregate impact: on master,

julia> using ImageContrastAdjustment, BenchmarkTools

julia> img = rand(Float32, 2048, 2048);

julia> @btime adjust_histogram($img, Equalization(nbins = 256));
  44.144 ms (6 allocations: 16.01 MiB)

but on this branch

julia> @btime adjust_histogram($img, Equalization(nbins = 256));
  18.238 ms (7 allocations: 16.01 MiB)
codecov[bot] commented 3 years ago

Codecov Report

Merging #53 (776b4e4) into master (37000d7) will decrease coverage by 0.07%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #53      +/-   ##
==========================================
- Coverage   95.97%   95.89%   -0.08%     
==========================================
  Files          12       12              
  Lines         546      585      +39     
==========================================
+ Hits          524      561      +37     
- Misses         22       24       +2     
Impacted Files Coverage Δ
src/algorithms/common.jl 100.00% <100.00%> (ø)
src/algorithms/equalization.jl 93.75% <100.00%> (+0.41%) :arrow_up:
src/build_histogram.jl 92.00% <100.00%> (-1.48%) :arrow_down:
src/algorithms/linear_stretching.jl 95.00% <0.00%> (-1.62%) :arrow_down:
src/algorithms/adaptive_equalization.jl 100.00% <0.00%> (ø)
src/algorithms/midway_equalization.jl 96.15% <0.00%> (+0.07%) :arrow_up:
src/algorithms/gamma_correction.jl 92.59% <0.00%> (+0.59%) :arrow_up:
src/core.jl 95.65% <0.00%> (+0.65%) :arrow_up:
... and 1 more

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 37000d7...776b4e4. Read the comment docs.