Skip to content

Commit

Permalink
Fix leg probabilities, see wg-perception#101
Browse files Browse the repository at this point in the history
  • Loading branch information
stwirth committed Apr 20, 2023
1 parent ab5309b commit c41ef4e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions leg_detector/src/leg_detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,9 +731,9 @@ class LegDetector

memcpy(tmp_mat.data, f.data(), f.size()*sizeof(float));

float probability = 0.5 -
forest->predict(tmp_mat, cv::noArray(), cv::ml::RTrees::PREDICT_SUM) /
forest->getRoots().size();
float probability = 0.5 + 0.5 *
static_cast<float>(forest->predict(tmp_mat, cv::noArray(), cv::ml::RTrees::PREDICT_SUM)) /
static_cast<float>(forest->getRoots().size());

tf::Stamped<tf::Point> loc((*i)->center(), scan->header.stamp, scan->header.frame_id);
try
Expand Down

0 comments on commit c41ef4e

Please sign in to comment.