Closed mloubout closed 4 years ago
It can't/shouldn't be fully conservative, otherwise imfilter(::Array{Bool}, kernel)
would throw an InexactError
for kernels that use floating-point coefficients.
Let me guess, kernel
is defined in terms of Float64
? What happens if you convert it to Float32
, too?
Then the final issue is whether we should do that conversion automagically. I lean away from that because what if filter
is something big (say, another image) and you're actually using this to compute a correlation? In such cases img
and kernel
are on equal footing.
I'm going to close this since there hasn't been any objection to the points raised in my reply.
Hello
It looks like imfilter does not conserve types, for example
imfilter(Array{Float32}, kernel)
returnsArray{Float64}