Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/Images.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ using TiledIteration: EdgeIterator
include("misc.jl")
include("labeledarrays.jl")
include("algorithms.jl")
include("exposure.jl")
include("deprecations.jl")
include("corner.jl")
include("edge.jl")
Expand Down Expand Up @@ -152,7 +151,6 @@ export
clearborder,

#Exposure
complement,
imhist,
histeq,
adjust_gamma,
Expand Down
22 changes: 1 addition & 21 deletions src/algorithms.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Base: axes1, tail
using OffsetArrays
import Statistics
using Statistics: mean, var
using Statistics: mean
import AxisArrays
using ImageMorphology: dilate!, erode!

Expand Down Expand Up @@ -76,26 +76,6 @@ function sumfinite!(S, K, A::AbstractArray{T,N}) where {T,N}
end
_newindexer(ax) = Base.Broadcast.shapeindexer(ax)

function Statistics.var(A::AbstractArray{C}; kwargs...) where C<:AbstractGray
imgc = channelview(A)
base_colorant_type(C)(var(imgc; kwargs...))
end

function Statistics.var(A::AbstractArray{C,N}; kwargs...) where {C<:Colorant,N}
imgc = channelview(A)
colons = ntuple(d->Colon(), Val(N))
inds1 = axes(imgc, 1)
val1 = Statistics.var(view(imgc, first(inds1), colons...); kwargs...)
vals = similar(imgc, typeof(val1), inds1)
vals[1] = val1
for i in first(inds1)+1:last(inds1)
vals[i] = Statistics.var(view(imgc, i, colons...); kwargs...)
end
base_colorant_type(C)(vals...)
end

Statistics.std(A::AbstractArray{C}; kwargs...) where {C<:Colorant} = mapc(sqrt, Statistics.var(A; kwargs...))

# Entropy for grayscale (intensity) images
function _log(kind::Symbol)
if kind == :shannon
Expand Down
13 changes: 0 additions & 13 deletions src/exposure.jl

This file was deleted.

8 changes: 0 additions & 8 deletions test/algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,6 @@ using Test

Random.seed!(1234)

@testset "Complement" begin
@test complement.([Gray(0.2)]) == [Gray(0.8)]
@test complement.([Gray{N0f8}(0.2)]) == [Gray{N0f8}(0.8)]
@test complement.([RGB(0,0.3,1)]) == [RGB(1,0.7,0)]
@test complement.([RGBA(0,0.3,1,0.7)]) == [RGBA(1.0,0.7,0.0,0.7)]
@test complement.([RGBA{N0f8}(0,0.6,1,0.7)]) == [RGBA{N0f8}(1.0,0.4,0.0,0.7)]
end

@testset "Entropy" begin
img = rand(1:10,10,10)
img2 = rand(1:2,10,10)
Expand Down
5 changes: 0 additions & 5 deletions test/exposure.jl
Original file line number Diff line number Diff line change
Expand Up @@ -515,11 +515,6 @@ eye(m,n) = Matrix{Float64}(I,m,n)
@test eltype(imadjustintensity(img)) == Gray{N0f16}

img = Gray{N0f16}.([0.01164 0.01118; 0.01036 0.01187])
@test complement(Gray(0.5)) == Gray(0.5)
@test complement(Gray(0.2)) == Gray(0.8)
@test all(complement.(img) .== 1 .- img)
# deprecated (#690)
@test all(complement.(img) .== 1 .- img)

hist = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

Expand Down