I am trying to check the type of the elements of an image that is passed to a function which is inside a module.
Consider I define img as follows:
using Images
img = colorview(Gray, array);
Then inside the function in my module:
import Images
eltype(img) in [Gray{Float64}, Gray{Float32}, Gray{Float16} ]
But I get an error that Gray
is not defined.
I have two questions:
-
How can I import an element type into my module?
(I am not writingusing Images
in my module) -
How can I check if the element type is
Gray
?
(I do not care about number typeGray{Any type here is fine}
)