Skip to content

Commit

Permalink
Added tests failing without the fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieu17g committed Aug 5, 2023
1 parent 00e236e commit 4ceeed5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/brisk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,10 @@ end
reverse_keypoints_1 = [_reverserotate(m[1], pi / 4, (256, 256)) + CartesianIndex(10, 20) for m in matches]
@test all(isapprox(rk[1], m[2][1], atol = 4) && isapprox(rk[2], m[2][2], atol = 4) for (rk, m) in zip(reverse_keypoints_1, matches))
end

@testset "Testing descriptor creation with an image leading to sampled intensities > 1.0" begin
img = Gray.(testimage("autumn_leaves"))
# Number of contiguous pixels parameter in fastcorner needs to be low, to yield enough corners to hit a sample intensity > 1
brisk_params = BRISK()
@test_nowarn create_descriptor(img, feats, brisk_params)
end
8 changes: 8 additions & 0 deletions test/freak.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,11 @@ end
reverse_keypoints_1 = [_reverserotate(m[1], pi / 4, (256, 256)) + CartesianIndex(10, 20) for m in matches]
@test isapprox(sum(isapprox(rk[1], m[2][1], atol = 4) && isapprox(rk[2], m[2][2], atol = 4) for (rk, m) in zip(reverse_keypoints_1, matches)), length(matches), atol = 2)
end

@testset "Testing descriptor creation with an image leading to sampled intensities > 1.0" begin
img = Gray.(testimage("autumn_leaves"))
# Number of contiguous pixels parametre in fastcorner needs to be low, to yield enough corners to hit a sample intensity > 1
keypoints = Keypoints(fastcorners(img, 5, 0.3))
freak_params = FREAK()
@test_nowarn create_descriptor(img, keypoints, freak_params)
end

0 comments on commit 4ceeed5

Please sign in to comment.