Skip to content

Not so canny canny method? #914

@JobJob

Description

@JobJob
img = rand(RGB{N0f8}, 100, 100)
canny(img, (Percentile(80), Percentile(20)))

Gives a

ERROR: MethodError: no method matching canny(::Array{Gray{Normed{UInt8,8}},2})
Stacktrace:
 [1] canny(::Array{RGB{Normed{UInt8,8}},2}, ::Tuple{Percentile{Int64},Percentile{Int64}}) at Images/7FSUM/src/edge.jl:410

Seems this code just needs to forward the threshold argument:

Images.jl/src/edge.jl

Lines 410 to 411 in 3951d87

canny(img::AbstractMatrix, threshold::Tuple{N,N}, args...) where {N<:Union{NumberLike,Percentile{NumberLike}}} =
canny(convert(Array{Gray}, img), args...)

i.e. canny(convert(Array{Gray}, img), threshold, args...) though a warning suggests that maybe it should be canny(Gray.(img), threshold, args...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions