diff --git a/test/test-brighten.jl b/test/test-brighten.jl new file mode 100644 index 00000000..2b29fd88 --- /dev/null +++ b/test/test-brighten.jl @@ -0,0 +1,22 @@ +using IceFloeTracker: get_brighten_mask, imbrighten + +@testset "brighten tests" begin + @testset "get_brighten_mask" begin + img = rand(0:255, 5, 5) + bumped_img = img .+ 1 + mask = get_brighten_mask(img, bumped_img) + @test all(mask .== 0) + end + + @testset "imbrighten tests" begin + img = [1 2; 3 4] + brighten_mask = [1 0; 1 0] + + test_cases = [(1.25, [1 2; 4 4]), (0.1, [0 2; 0 4]), (0.9, img)] + + for (bright_factor, expected_result) in test_cases + result = imbrighten(img, brighten_mask, bright_factor) + @test result == expected_result + end + end +end \ No newline at end of file