Skip to content

AdjustBrightness and AdjustContrast without clamp01 #76

@itan1

Description

@itan1

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?

function adjustcontrast!(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)
    end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions