Commit 80c5bef5 authored by Vincent POLLET's avatar Vincent POLLET
Browse files

Merge branch 'landmarks_bbox_unit_test' into 'master'

Landmarks bbox unit test

See merge request !7
parents 0b584bf7 e1ee5d8b
Pipeline #44016 canceled with stage
in 2 minutes and 54 seconds
......@@ -96,6 +96,10 @@ def test_stereo_mapping_and_project():
right_image = np.expand_dims(load(resource_path("test/data/nir_right_stereo.png")), 0)
color_image = load(resource_path("test/data/color.png"))
# load landmarks and bounding box
landmarks = np.load(resource_path("test/data/landmarks.npy"))
bounding_box = np.load(resource_path("test/data/bounding_box.npy"))
# Load camera configurations
nir_left_stereo = load_camera_config(resource_path("config/idiap_face_calibration.json"), "nir_left")
nir_right_stereo = load_camera_config(resource_path("config/idiap_face_calibration.json"), "nir_right")
......@@ -110,14 +114,19 @@ def test_stereo_mapping_and_project():
map_3d = stereo_match(left_image, right_image, camera_pair, stereo_parameters)
# project color image on left camera (rectified)
projected_image = reproject_image(color_image, map_3d, color, camera_pair)
projected_image = reproject_image(color_image, map_3d, color, camera_pair, bounding_box, landmarks)
# Compare to saved values
groundtruth_color_image = np.load(resource_path("test/data/projected_image.npy"))
groundtruth_map_3d = np.load(resource_path("test/data/map_3d.npy"))
groundtruth_landmarks = np.load(resource_path("test/data/projected_landmarks.npy"))
groundtruth_bounding_box = np.load((resource_path("test/data/projected_bounding_box.npy")))
assert groundtruth_color_image.shape == projected_image.shape
assert groundtruth_map_3d.shape == map_3d.shape
assert is_close_enough(groundtruth_color_image, projected_image)
assert is_close_enough(groundtruth_map_3d, map_3d)
assert np.array_equal(bounding_box, groundtruth_bounding_box)
assert np.allclose(landmarks, groundtruth_landmarks)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment