Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added lru caching for faster undistortion #1007

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

originlake
Copy link
Contributor

@originlake originlake commented Jul 3, 2023

In undistortion, computing camera mapping is the most expensive part, but it's only related to the camera model and image size, hence for each camera model and size, it only needs to be calculated once, and all the undistortion can use the same camera mapping.

This PR introduces a simple thread/process safe LRU cache wrapper to cache the camera mapping results so future undistortion can reuse it. This should greatly speed up the undistortion stage.

(The cmakelists.txt and similarity_model.cc changes are used to fix a bug when building c extensions in debug mode, **undefined symbol**)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants