ImageEdgeDetection: The basic usage example will not compile

I am completely new to Julia. I want to use some image manipulation functions including those in the ImageEdgeDetection package but already the basic use example provided on the ImageEdgeDetection page will not run.

In Pluto, this cell will run:
begin
using TestImages, Images, ImageIO
img = testimage(“mandril_gray”)
img
end

So the image is there, but this next one:

begin
using ImageEdgeDetection, MosaicViews, Interpolations
img_edges₁ = detect_edges(img, Canny(spatial_scale = 1.4))
img_edges₂ = detect_edges(img, Canny(spatial_scale = 2.8))
img_edges₃ = detect_edges(img, Canny(spatial_scale = 5.6))
demo₁ = mosaicview(img, img_edges₁, img_edges₂, img_edges₃; nrow = 2)
end

returns this error:

MethodError: no method matching (::Interpolations.Extrapolation{Float64,2,Interpolations.BSplineInterpolation{Float64,2,Array{Float64,2},Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}},Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}},Interpolations.BSpline{Interpolations.Linear{Interpolations.Throw{Interpolations.OnGrid}}},Interpolations.Flat{Nothing}})(::ColorTypes.Gray{Float64}, ::ColorTypes.Gray{Float64})

(Compared to the base use case on the ImageEdgeDetection page I added “using Interpolations” inspired by the error message but it makes no difference. (I believe that it is included in the “Images” package already)).

…so I am stuck before I began. Help will be most appreciated, thanks,

Sorry you encountered trouble! In about 15 minutes from now, try upgrading your packages; version 0.1.4 should fix the issues you encountered.

3 Likes

Dear Tim and Zygmunt,

Thanks a lot - it works!

Cheers,

Peter