You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the output images are clamped with clamp01 in AdjustBrightness (here) and AdjustContrast (here).
I am working with medical data with a different grayscale range than [0,1] so I would like to use the augmentation methods but without clamping. Was there a specific reason to use the clamping? Can I add an optional clamp flag like below?
functionadjustcontrast!(dst::AbstractArray{U}, img::AbstractArray{T}, factor; clamp=true) where {T, U}
map!(dst, img) do x
convert(U, clamp ?clamp01(x * factor) : x * factor)
endend
The text was updated successfully, but these errors were encountered:
The reason for the default clamping is that the default low-memory color type is RGB{N0f8} which is represented under the hood as UInt8s. When trying to convert a number outside the inveral [0, 1] back to that representation, an error is thrown.
Happy to accept a PR adding the clamp = true flag for AdjustBrightness and AdjustContrast :)
Currently the output images are clamped with
clamp01
in AdjustBrightness (here) and AdjustContrast (here).I am working with medical data with a different grayscale range than [0,1] so I would like to use the augmentation methods but without clamping. Was there a specific reason to use the clamping? Can I add an optional clamp flag like below?
The text was updated successfully, but these errors were encountered: