OpenCV: issue with function argument type in Julia binding

Mm, I’m pretty sure it’s still relevant. The error you posted is:

MethodError: no method matching split(::Array{UInt8,3}, ::Array{OpenCV.Mat{UInt8},1})

and the candidate is:

split(::Union{OpenCV.CxxMat, AbstractArray{T,3} where T<:Union{Float32, Float64, Int16, Int32, Int8, UInt16, UInt8}}, !Matched::Array{Union{OpenCV.CxxMat, AbstractArray{T,3} where T<:Union{Float32, Float64, Int16, Int32, Int8, UInt16, UInt8}},1}) at /home/wahara/build/OpenCV/src/cv_cxx_wrap.jl:2304

from which the relevant part is:

!Matched::Array{Union{...}}

which is exactly what I described above. You’ve used the <: operator to define InputArray, but your split function is still defined using Array{InputArray, 1} as its argument type, whereas it should be Array{<:InputArray, 1} .

1 Like