You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use DSP.conv to do some simple image filtering on a grayscale image, but it seems like the datatype is not supported:
using TestImages
using ImageView
using DSP
img =float(testimage("cameraman"))
# build kernel
xs = ys =-2:2kernel_func(x, y) =exp(1/sqrt(x^2+ y^2))
kernel = [kernel_func(x, y) for x in xs, y in ys]
kernel[size(kernel) .÷2.+1...] =exp(1)
# convolve
result =conv(kernel, img)
ImageView.imshow(result)
ERROR: LoadError: MethodError: no method matching conv(::Array{Float64,2}, ::Array{ColorTypes.Gray{Float32},2})
Closest candidates are:
conv(::AbstractArray{T,N}, ::AbstractArray{T,N}) where {T<:Union{Complex{Float32}, Complex{Float64}, Float32, Float64}, N} at /home/evan/.julia/packages/DSP/amvJg/src/dspbase.jl:688
conv(::AbstractArray{var"#s3445",N} where var"#s3445"<:Union{Complex{Float32}, Complex{Float64}, Float32, Float64}, ::AbstractArray{var"#s3444",N} where var"#s3444"<:Union{Complex{Float32}, Complex{Float64}, Float32, Float64}) where N at /home/evan/.julia/packages/DSP/amvJg/src/dspbase.jl:699
conv(::AbstractArray{var"#s3445",N} where var"#s3445"<:Number, ::AbstractArray{var"#s3444",N} where var"#s3444"<:Union{Complex{Float32}, Complex{Float64}, Float32, Float64}) where N at /home/evan/.julia/packages/DSP/amvJg/src/dspbase.jl:711
...
Stacktrace:
[1] top-level scope at /home/evan/research/2022_focal_drift/convolution_test.jl:14
[2] include(::String) at ./client.jl:457
[3] top-level scope at REPL[79]:1
in expression starting at /home/evan/research/2022_focal_drift/convolution_test.jl:14
The text was updated successfully, but these errors were encountered:
I'm trying to use
DSP.conv
to do some simple image filtering on a grayscale image, but it seems like the datatype is not supported:The text was updated successfully, but these errors were encountered: