{"id":21183139,"url":"https://github.com/samkg/bundle-adjustment","last_synced_at":"2025-03-14T19:45:33.864Z","repository":{"id":105716533,"uuid":"573335229","full_name":"SamKG/Bundle-Adjustment","owner":"SamKG","description":"Bundle adjustment using sparse Levenberg-Marquadt with damping","archived":false,"fork":false,"pushed_at":"2022-12-26T14:56:24.000Z","size":1824,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T12:34:21.505Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SamKG.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-02T08:10:50.000Z","updated_at":"2023-02-13T08:55:07.000Z","dependencies_parsed_at":"2023-06-13T07:15:11.927Z","dependency_job_id":null,"html_url":"https://github.com/SamKG/Bundle-Adjustment","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKG%2FBundle-Adjustment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKG%2FBundle-Adjustment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKG%2FBundle-Adjustment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamKG%2FBundle-Adjustment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamKG","download_url":"https://codeload.github.com/SamKG/Bundle-Adjustment/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243639400,"owners_count":20323505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T17:59:20.774Z","updated_at":"2025-03-14T19:45:33.859Z","avatar_url":"https://github.com/SamKG.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# What is this?\nThis is an implementation of [Bundle Adjustment](https://en.wikipedia.org/wiki/Bundle_adjustment) using the Levenberg-Marquardt algorithm.\n\n# What's Bundle Adjustment?\nImagine you have 2 pictures of the same scene, each with different viewpoints. Imagine we specify some landmarks in the scene (e.g. a tree). You want to figure out: \n1. The positions and poses of the cameras\n2. The absolute positions of the landmarks\n\nBundle adjustment is a technique in which is able to solve for these two, by minimizing a loss function.\n\n# Tricks\n## Damping\nTo help solutions converge, we rely on the Levenberg-Marquadt algorithm with damping. Damping allows the algorithm to take small steps when near to a solution, and larger steps otherwise. \n\n## Sparsity\nWe also take advantage of sparsity to improve convergence - essentially, the matrix J^TJ using in Levenberg-Marquardt is highly sparse. We partition the matrix into regions A,B,C, such that A, B are block diagonal matrices, and C is a dense matrix. We implement versions of matrix inversion and linear matrix equation solving which take advantage of the block structure of A and B to reduce computation. \n\n## Gradient checking\nThe code takes advantage of hand-derived jacobians for various operations. To verify these hand-derived jacobians, we used PyTorch.\n\n# How to run\n1. First install numpy: `pip install numpy` \n2. Next, you may run bundle adjustment for a problem using: `python3 bundle_adjustment.py --problem \u003cproblemfile\u003e`\n\nThe solutions will be output into the same working directory as the bundle adjustment script.\n\nTo evaluate the final loss for a solution, you may run:\n`python3 eval_reconstruction.py --solution \u003csolutionfile\u003e`\n\n# Caveats\n## Numerical Precision\nWe do blocked matrix operations for efficiency. However, we do not implement any techniques to improve numerical precision of solutions. Since our matrices are large, this means that our computation is off from the ground truth by quite a bit, which may hurt convergence in some cases. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamkg%2Fbundle-adjustment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamkg%2Fbundle-adjustment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamkg%2Fbundle-adjustment/lists"}