Skip to content

Commit

Permalink
trying to pass CI by adding an initial corner detection
Browse files Browse the repository at this point in the history
  • Loading branch information
yakir12 committed Dec 24, 2024
1 parent c82909c commit 38ab7e3
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions test/test_corner_detection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,26 @@ function calc_error(ps1, ps2)
sqrt(s/length(ps1))
end

function test_one(img_file, data_file)
corners, n_corners = parse_corners_file(data_file)
detected_corners = _detect_corners(img_file, n_corners)
calc_error(corners, detected_corners)
end

@testset "detecting corners" begin

path = joinpath(test_dir, "cameracalibration")
list = get_list(joinpath(path, "chessboard_list.dat"))

k, v = first(list)
test_one(joinpath(path, k), joinpath(path, v)) # why do we need this?

@testset "in $k" for (k, v) in list

img_file = joinpath(path, k)
data_file = joinpath(path, v)

corners, n_corners = parse_corners_file(data_file)
detected_corners = _detect_corners(img_file, n_corners)
detected_corners = _detect_corners(img_file, n_corners)

ϵ = calc_error(corners, detected_corners)

@test ϵ < 1
@test test_one(img_file, data_file) < 1

end
end

0 comments on commit 38ab7e3

Please sign in to comment.