Skip to content

Commit

Permalink
Merge pull request #326 from timholy/teh/precision
Browse files Browse the repository at this point in the history
Fix two test failures related to precision
  • Loading branch information
timholy committed Aug 5, 2015
2 parents dac0727 + 3fc3fb0 commit 71b9d3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ difftype{CV<:AbstractRGB,T<:Real}(::Type{CV}, ::Type{T}) = RGB{Float32}
difftype{CV<:AbstractRGB}(::Type{CV}, ::Type{Float64}) = RGB{Float64}

accum{T<:Integer}(::Type{T}) = Int
accum(::Type{Float32}) = Float32
accum{T<:Real}(::Type{T}) = Float64

# normalized by Array size
Expand Down
4 changes: 3 additions & 1 deletion test/algorithms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,9 @@ facts("Algorithms") do
Afft = Images.imfilter_fft(A, kern, "inner")
@fact Af => roughly(Afft)
h = [0.24,0.87]
@fact Images.imfilter(eye(3), h, "inner") => roughly(Images.imfilter_fft(eye(3), h, "inner")) # issue #204
hfft = Images.imfilter_fft(eye(3), h, "inner")
hfft[abs(hfft) .< 3eps()] = 0
@fact Images.imfilter(eye(3), h, "inner") => roughly(hfft) # issue #204

@fact approx_equal(Images.imfilter_gaussian(ones(4,4), [5,5]), 1.0) => true
A = fill(convert(Float32, NaN), 3, 3)
Expand Down

0 comments on commit 71b9d3f

Please sign in to comment.