UZ-SLAMLab / ORB_SLAM3

ORB-SLAM3: An Accurate Open-Source Library for Visual, Visual-Inertial and Multi-Map SLAM
GNU General Public License v3.0
6.64k stars 2.57k forks source link

improved speed of IC_Angle #878

Closed spdfghi closed 6 months ago

spdfghi commented 7 months ago

original code reduces computational overhead for centroid calculation by combining two lines together. So, I generalized it to four symmetric points, further reducing the multiplication operations and cutting down the time by approximately 1/6 to 1/5.

jeremysalwen commented 4 months ago

Did you benchmark this at all?

spdfghi commented 4 months ago

Not actually, since it depends on the numbers of FAST pointer, I just tested it with random generated image, and only count the time of this function, which agree with a simple math: https://github.com/opencv/opencv/issues/25879. Opencv repository administrator did benchmark in their performance test(for whole ORB detect), the patch makes single threaded implementation 1-3% faster. @jeremysalwen

jeremysalwen commented 4 months ago

Ok great if you benchmarked it in isolation that is enough IMO. I am merging this PR into my community version of ORB_SLAM that I am maintaining since it seems like the original repositories are inactive: https://github.com/jeremysalwen/ORB_SLAM_COMMUNITY. I would welcome any other improvements you have as well :)