Skip to content

RMSE Calculation in EvaluateRANSACBasedOnDistance MethodΒ #6291

Closed

Description

@pherrusa7

Checklist

My Question

Hello everyone,

First of all, thank you for your contributions to this great library!

This question might or might not turn into a minor bug. I was reading the code for EvaluateRANSACBasedOnDistance and I found the following formula:
result.inlier_rmse_ = error / std::sqrt((double)inlier_num);

However, error is collected by adding absolute values (as opposed to squared):

double distance = std::abs(plane_model.dot(point));
...
error += distance;

Given how the error is accumulated I was expecting to find a mean absolute error. Is there any reason for the denominator to be the square root of the sample size rather than just the sample size? I might be missing something (or maybe it is indeed a minor bug) so any ideas are welcome.

Thank you for your time :)

Activity

  1. theNded commented on Aug 10, 2023

    @theNded
    Contributor

    This is a good catch! I think it is a bug. I will mark it on my TODO list and fix it.

  2. added
    bug
    and removed on Aug 10, 2023
  3. self-assigned this
    on Aug 10, 2023
  4. pherrusa7 commented on Aug 10, 2023

    @pherrusa7
    Author

    Glad to be helpful! I'd be happy to do a PR with some guidance. Specifically, do you think the error should be squared during accumulation or averaged later by the number of samples? Also, is there a reference paper based on which this routine was implemented?

  5. theNded commented on Aug 11, 2023

    @theNded
    Contributor

    They should be squared. I think it is relatively a trivial problem now and can be traced back to 2000s. MATLAB has a reference list: https://www.mathworks.com/help/vision/ref/pcfitplane.html

  6. pherrusa7 commented on Aug 11, 2023

    @pherrusa7
    Author

    Yes, that makes sense. I see that you already made the changes so it is done. Thank you!

  7. added a commit that references this issue on Aug 15, 2023
    1012819
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugregistration

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions