diff --git a/rpt/triangulator.cpp b/rpt/triangulator.cpp index b4fd512..0abccf6 100644 --- a/rpt/triangulator.cpp +++ b/rpt/triangulator.cpp @@ -828,6 +828,27 @@ std::vector>> TriangulatorInternal::triangulate auto [pose3d, score] = triangulate_and_score( pose1, pose2, cam1, cam2, roomparams, {}); + + // Scale scores with 2D confidences + // They can improve the merge weighting, but especially the earlier step of pair-filtering + // works better if only per-view consistency is used, so they are not included before. + for (size_t j = 0; j < pose3d.size(); ++j) + { + float score1 = pose1[j][2]; + float score2 = pose2[j][2]; + float min_score = 0.1; + + if (score1 > min_score && score2 > min_score) + { + float scoreP = (score1 + score2) * 0.5; + float scoreT = pose3d[j][3]; + + // Since the triangulation score is less sensitive and generally higher, + // weight it stronger to balance the two scores. + pose3d[j][3] = 0.9 * scoreT + 0.1 * scoreP; + } + } + all_full_poses[i] = std::move(pose3d); } @@ -1430,11 +1451,7 @@ std::pair>, float> TriangulatorInternal::triang if (mask[i]) { float scoreT = 0.5 * (score1[i] + score2[i]); - float scoreP = 0.5 * (pose1[i][2] + pose2[i][2]); - - // Since the triangulation score is less sensitive and generally higher, - // weight it stronger to balance the two scores. - pose3d[i][3] = 0.9 * scoreT + 0.1 * scoreP; + pose3d[i][3] = scoreT; } } diff --git a/scripts/test_skelda_dataset.py b/scripts/test_skelda_dataset.py index 0fff96c..e445f8a 100644 --- a/scripts/test_skelda_dataset.py +++ b/scripts/test_skelda_dataset.py @@ -41,7 +41,7 @@ default_min_bbox_score = 0.3 # Describes how good two 2D poses need to match each other to create a valid triangulation # If the quality of the 2D detections is poor, use a lower value -default_min_match_score = 0.91 +default_min_match_score = 0.94 # Describes the minimum number of camera pairs that need to detect the same person # If the number of cameras is high, and the views are not occluded, use a higher value @@ -55,7 +55,7 @@ datasets = { "human36m": { "path": "/datasets/human36m/skelda/pose_test.json", "take_interval": 5, - "min_match_score": 0.92, + "min_match_score": 0.95, "min_group_size": 1, "min_bbox_score": 0.4, "min_bbox_area": 0.1 * 0.1, @@ -68,7 +68,7 @@ datasets = { # "cams": ["00_03", "00_06", "00_12", "00_13", "00_23", "00_15", "00_10", "00_21", "00_09", "00_01"], # "cams": [], "take_interval": 3, - "min_match_score": 0.92, + "min_match_score": 0.95, "use_scenes": ["160906_pizza1", "160422_haggling1", "160906_ian5"], "min_group_size": 1, # "min_group_size": 4, @@ -79,25 +79,25 @@ datasets = { "path": "/datasets/mvor/skelda/all.json", "take_interval": 1, "with_depth": False, - "min_match_score": 0.80, + "min_match_score": 0.85, "min_bbox_score": 0.25, }, "campus": { "path": "/datasets/campus/skelda/test.json", "take_interval": 1, - "min_match_score": 0.89, + "min_match_score": 0.92, "min_bbox_score": 0.5, }, "shelf": { "path": "/datasets/shelf/skelda/test.json", "take_interval": 1, - "min_match_score": 0.92, + "min_match_score": 0.95, "min_group_size": 2, }, "ikeaasm": { "path": "/datasets/ikeaasm/skelda/test.json", "take_interval": 2, - "min_match_score": 0.89, + "min_match_score": 0.92, "min_bbox_score": 0.20, }, "chi3d": { @@ -107,21 +107,20 @@ datasets = { "tsinghua": { "path": "/datasets/tsinghua/skelda/test.json", "take_interval": 3, - "min_match_score": 0.92, + "min_match_score": 0.95, "min_group_size": 2, }, "human36m_wb": { "path": "/datasets/human36m/skelda/wb/test.json", "take_interval": 100, "min_bbox_score": 0.4, - "min_match_score": 0.93, "batch_poses": False, }, "egohumans_tagging": { "path": "/datasets/egohumans/skelda/all.json", "take_interval": 2, "subset": "tagging", - "min_match_score": 0.89, + "min_match_score": 0.92, "min_group_size": 2, "min_bbox_score": 0.2, "min_bbox_area": 0.05 * 0.05, diff --git a/scripts/test_triangulate.py b/scripts/test_triangulate.py index 81d5c7a..04c3885 100644 --- a/scripts/test_triangulate.py +++ b/scripts/test_triangulate.py @@ -19,7 +19,7 @@ whole_body = { "hands": False, } config = { - "min_match_score": 0.91, + "min_match_score": 0.94, "min_group_size": 1, "min_bbox_score": 0.3, "min_bbox_area": 0.1 * 0.1,