Colorspace Transforms
Since we require the last dimension to be the batch dimension, kindly unsqueeze the last dimension if you would like to pass a single image.
DiffImages.channelify
— Methodchannelify(m::AbstractArray{CT,N}) where {CT <: Colorant, N}
Channelify function.
Input should be in $WHN$ order $\implies (*, batch)$. Output will be in the order $(*, channels, batch)$.
Examples
julia> input_size = (16, 16, 2)
(16, 16, 2)
julia> size(channelify(HSV.(rand(BGR,input_size...))))
(16, 16, 3, 2)
DiffImages.colorify
— Methodcolorify(color::Type{CT}, m::AbstractArray) where CT <: Colorant
Colorify function.
Expecting an input of the type $(*, channels, batch)$. Converts the array to the color
specified.
Examples
julia> input_size = (25, 25, 3, 7)
(25, 25, 3, 7)
julia> size(colorify(HSV, rand(input_size...)))
(25, 25, 7)