wg-perception / people

269 stars 197 forks source link

leg probabilities are different between Kinetic and Melodic #100

Open s-kodama-isp opened 3 years ago

s-kodama-isp commented 3 years ago

We found that detected results by leg_detector are different between Kinetic and Melodic in our internal test. It looked that bugs pointed out in #67 about leg probabilities remain in the Melodic version. We think that the probability calculation in leg_detector.cpp(L735-737) is wrong. https://github.com/wg-perception/people/blob/bc73fa0c2ff96da27688e3ad503a1aa4342d214a/leg_detector/src/leg_detector.cpp#L735-L737

As results, probabilities take values between -0.5 and 1.5.

So, we want to fix as below.

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());

After we fixed this bug as the above, we got almost the same results between Kinetic and Melodic in our internal test. We will create a pull request. Thanks.