Skip to content

leg probabilities are different between Kinetic and Melodic #100

@s-kodama-isp

Description

@s-kodama-isp

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.

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions