AprilRobotics / apriltag

AprilTag is a visual fiducial system popular for robotics research.
https://april.eecs.umich.edu/software/apriltag
Other
1.47k stars 522 forks source link

Speed up cluster merge by batch copying arrays #280

Closed bouk closed 1 year ago

bouk commented 1 year ago

I was looking through the code and found that a lot of time was being spent on 'make clusters' so I did a quick look through why that is the case. I found the merge_clusters function to be inefficient, so I optimized it to do batch memcopies wherever possible.

This gives me a ~20% reduction in time spent for a large image.

Before

Screenshot 2023-06-15 at 14 33 47

After

Screenshot 2023-06-15 at 14 33 56
bouk commented 1 year ago

@christian-rauch addressed your comments!