Renamed a parameter.
This commit is contained in:
@ -4,9 +4,9 @@
|
||||
// =================================================================================================
|
||||
// =================================================================================================
|
||||
|
||||
Triangulator::Triangulator(float min_score, size_t min_group_size)
|
||||
Triangulator::Triangulator(float min_match_score, size_t min_group_size)
|
||||
{
|
||||
this->triangulator = new TriangulatorInternal(min_score, min_group_size);
|
||||
this->triangulator = new TriangulatorInternal(min_match_score, min_group_size);
|
||||
}
|
||||
|
||||
// =================================================================================================
|
||||
|
||||
@ -19,11 +19,11 @@ public:
|
||||
* Triangulator to predict poses from multiple views.
|
||||
*
|
||||
*
|
||||
* @param min_score Minimum score to consider a triangulated joint as valid.
|
||||
* @param min_match_score Minimum score to consider a triangulated joint as valid.
|
||||
* @param min_group_size Minimum number of camera pairs that need to see a person.
|
||||
*/
|
||||
Triangulator(
|
||||
float min_score = 0.95,
|
||||
float min_match_score = 0.95,
|
||||
size_t min_group_size = 1);
|
||||
|
||||
/**
|
||||
|
||||
@ -102,9 +102,9 @@ void CameraInternal::update_projection_matrix()
|
||||
// =================================================================================================
|
||||
// =================================================================================================
|
||||
|
||||
TriangulatorInternal::TriangulatorInternal(float min_score, size_t min_group_size)
|
||||
TriangulatorInternal::TriangulatorInternal(float min_match_score, size_t min_group_size)
|
||||
{
|
||||
this->min_score = min_score;
|
||||
this->min_match_score = min_match_score;
|
||||
this->min_group_size = min_group_size;
|
||||
}
|
||||
|
||||
@ -241,7 +241,7 @@ std::vector<std::vector<std::array<float, 4>>> TriangulatorInternal::triangulate
|
||||
stime = std::chrono::high_resolution_clock::now();
|
||||
|
||||
// Check matches to old poses
|
||||
float threshold = min_score - 0.2;
|
||||
float threshold = min_match_score - 0.2;
|
||||
std::map<size_t, std::map<size_t, std::vector<size_t>>> scored_pasts;
|
||||
if (!last_poses_3d.empty())
|
||||
{
|
||||
@ -447,7 +447,7 @@ std::vector<std::vector<std::array<float, 4>>> TriangulatorInternal::triangulate
|
||||
size_t num_poses = all_scored_poses.size();
|
||||
for (size_t i = num_poses; i > 0; --i)
|
||||
{
|
||||
if (all_scored_poses[i - 1].second < min_score)
|
||||
if (all_scored_poses[i - 1].second < min_match_score)
|
||||
{
|
||||
all_scored_poses.erase(all_scored_poses.begin() + i - 1);
|
||||
all_pairs.erase(all_pairs.begin() + i - 1);
|
||||
@ -456,7 +456,7 @@ std::vector<std::vector<std::array<float, 4>>> TriangulatorInternal::triangulate
|
||||
|
||||
// Group pairs that share a person
|
||||
std::vector<std::tuple<cv::Point3f, cv::Mat, std::vector<int>>> groups;
|
||||
groups = calc_grouping(all_pairs, all_scored_poses, min_score);
|
||||
groups = calc_grouping(all_pairs, all_scored_poses, min_match_score);
|
||||
|
||||
// Drop groups with too few matches
|
||||
size_t num_groups = groups.size();
|
||||
@ -508,7 +508,7 @@ std::vector<std::vector<std::array<float, 4>>> TriangulatorInternal::triangulate
|
||||
poses.push_back(all_full_poses[idx]);
|
||||
}
|
||||
|
||||
auto merged_pose = merge_group(poses, min_score);
|
||||
auto merged_pose = merge_group(poses, min_match_score);
|
||||
all_merged_poses[i] = (merged_pose);
|
||||
}
|
||||
|
||||
@ -548,7 +548,7 @@ std::vector<std::vector<std::array<float, 4>>> TriangulatorInternal::triangulate
|
||||
}
|
||||
pose.push_back(point);
|
||||
|
||||
if (point[3] > min_score)
|
||||
if (point[3] > min_match_score)
|
||||
{
|
||||
num_valid++;
|
||||
}
|
||||
@ -1860,7 +1860,7 @@ void TriangulatorInternal::add_missing_joints(
|
||||
for (size_t j = 0; j < num_joints; ++j)
|
||||
{
|
||||
float *pose_ptr = pose.ptr<float>(j);
|
||||
if (pose_ptr[3] > min_score)
|
||||
if (pose_ptr[3] > min_match_score)
|
||||
{
|
||||
valid_joint_idx.push_back(j);
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ public:
|
||||
class TriangulatorInternal
|
||||
{
|
||||
public:
|
||||
TriangulatorInternal(float min_score, size_t min_group_size);
|
||||
TriangulatorInternal(float min_match_score, size_t min_group_size);
|
||||
|
||||
std::vector<std::vector<std::array<float, 4>>> triangulate_poses(
|
||||
const std::vector<std::vector<std::vector<std::array<float, 3>>>> &poses_2d,
|
||||
@ -43,7 +43,7 @@ public:
|
||||
void print_stats();
|
||||
|
||||
private:
|
||||
float min_score;
|
||||
float min_match_score;
|
||||
float min_group_size;
|
||||
|
||||
const std::vector<std::string> core_joints = {
|
||||
|
||||
@ -281,7 +281,9 @@ def main():
|
||||
all_poses = []
|
||||
all_ids = []
|
||||
times = []
|
||||
triangulator = rpt.Triangulator(min_score=minscore, min_group_size=min_group_size)
|
||||
triangulator = rpt.Triangulator(
|
||||
min_match_score=minscore, min_group_size=min_group_size
|
||||
)
|
||||
old_scene = ""
|
||||
old_index = -1
|
||||
for label in tqdm.tqdm(labels):
|
||||
|
||||
@ -340,7 +340,7 @@ def main():
|
||||
else:
|
||||
cameras = rpt.convert_cameras(camparams)
|
||||
roomp = [roomparams["room_size"], roomparams["room_center"]]
|
||||
triangulator = rpt.Triangulator(min_score=0.95)
|
||||
triangulator = rpt.Triangulator(min_match_score=0.95)
|
||||
|
||||
stime = time.time()
|
||||
poses_3d = triangulator.triangulate_poses(
|
||||
|
||||
@ -60,7 +60,7 @@ def main():
|
||||
cameras = rpt.convert_cameras(cams)
|
||||
|
||||
# Run triangulation
|
||||
triangulator = rpt.Triangulator(min_score=0.95)
|
||||
triangulator = rpt.Triangulator(min_match_score=0.95)
|
||||
stime = time.time()
|
||||
poses_3d = triangulator.triangulate_poses(
|
||||
poses_2d, cameras, roomparams, joint_names
|
||||
|
||||
Reference in New Issue
Block a user