{"id":25601156,"url":"https://github.com/fixstars/cuda-bundle-adjustment","last_synced_at":"2025-04-05T22:10:00.200Z","repository":{"id":46735837,"uuid":"304270873","full_name":"fixstars/cuda-bundle-adjustment","owner":"fixstars","description":"A CUDA implementation of Bundle Adjustment","archived":false,"fork":false,"pushed_at":"2024-02-06T03:45:51.000Z","size":12313,"stargazers_count":381,"open_issues_count":13,"forks_count":47,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-29T21:07:09.763Z","etag":null,"topics":["bundle-adjustment","cuda","g2o","slam","structure-from-motion","visual-slam"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fixstars.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":"2020-10-15T09:11:35.000Z","updated_at":"2025-03-28T14:34:12.000Z","dependencies_parsed_at":"2024-02-06T04:44:12.771Z","dependency_job_id":null,"html_url":"https://github.com/fixstars/cuda-bundle-adjustment","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixstars%2Fcuda-bundle-adjustment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixstars%2Fcuda-bundle-adjustment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixstars%2Fcuda-bundle-adjustment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixstars%2Fcuda-bundle-adjustment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fixstars","download_url":"https://codeload.github.com/fixstars/cuda-bundle-adjustment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247406111,"owners_count":20933806,"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":["bundle-adjustment","cuda","g2o","slam","structure-from-motion","visual-slam"],"created_at":"2025-02-21T15:52:48.215Z","updated_at":"2025-04-05T22:10:00.160Z","avatar_url":"https://github.com/fixstars.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cuda-bundle-adjustment\nA CUDA implementation of Bundle Adjustment\n\n## Description\nThis project implements a Bundle Adjustment algorithm with CUDA.\nIt optimizes camera poses and landmarks (3D points) represented by a graph.\n\nThe reference CPU implementation is [RainerKuemmerle/g2o](https://github.com/RainerKuemmerle/g2o).\nThis project is designed to provide following g2o features, which are commonly used in Visual SLAM and SfM.\n\n- `g2o::BlockSolver_6_3`\n- `g2o::OptimizationAlgorithmLevenberg`\n- `g2o::VertexSE3Expmap`\n- `g2o::VertexPointXYZ`\n- `g2o::EdgeSE3ProjectXYZ`\n- `g2o::EdgeStereoSE3ProjectXYZ`\n- `g2o::RobustKernelHuber`\n- `g2o::RobustKernelTukey`\n\nFor example, see [Use cuda-bundle-adjustment in ORB-SLAM2](https://github.com/fixstars/cuda-bundle-adjustment/wiki/Use-cuda-bundle-adjustment-in-ORB-SLAM2).\n\n## Performance\n\nThe performance obtained from `sample/sample_comparison_with_g2o` is as follows.\n\n#### `Settings`\n\nKey|Value\n---|---\nCPU / implementation|Core-i7 6700K(4.00 GHz) / g2o\nGPU / implementation|GeForce GTX 1080 / cuda-bundle-adjustment\nnumber of iterations for optimization|10\n\n#### `Results`\nInput Filename|P|L|E|CPU[sec]|GPU[sec]\n---|---|---|---|---|---\nba_kitti_07.json|248|26127|95037|1.8|0.23\nba_kitti_00.json|1332|133383|561116|11.9|1.23\n\n**P**: number of poses, **L**: number of landmarks, **E**: number of edges\n\n## Limitations\nSome features supported in g2o are currently simplified or not implemented.\n\n- Information matrix is represented by a scalar\n- Camera parameters are associated with each of the pose vertices (not each of the edges)\n- Robust kernel is applied uniformly for all monocular(stereo) edges\n- Level optimization is not implemented\n\n## Requirements\n|Package Name|Minimum Requirements|Note|\n|---|---|---|\n|CMake|version \u003e= 3.18||\n|CUDA Toolkit|compute capability \u003e= 6.0|\n|Eigen|version \u003e= 3.2.0||\n|OpenCV||for sample|\n|g2o||for sample, optional|\n\n## How to build\n```\n$ git clone https://github.com/fixstars/cuda-bundle-adjustment.git\n$ cd cuda-bundle-adjustment\n$ mkdir build\n$ cd build\n$ cmake .. # Several options available (e.g. -WITH_G2O=ON -DCUDA_ARCHS=86)\n$ make\n```\n\n### CMake options\n|Option|Description|Default|\n|---|---|---|\n|ENABLE_SAMPLES|Build samples|`ON`|\n|WITH_G2O|Build sample with g2o|`OFF`|\n|USE_FLOAT32|Use 32bit float in internal floating-point operations|`OFF`|\n|BUILD_SHARED_LIB|Build shared library|`OFF`|\n|CUDA_ARCHS|List of architectures to generate device code for|`61;72;75;86`|\n\nWith `WITH_G2O` option, you can run `sample/sample_comparison_with_g2o`.\n[g2o](https://github.com/RainerKuemmerle/g2o) needs to be installed beforehand.\n\n```\n$ cmake -DWITH_G2O=ON ..\n```\n\nWith `USE_FLOAT32` option, 32bit float is used in internal floating-point operations (default is 64bit float).\nCurrently there is no significant speedup by this option.\n\n```\n$ cmake -DUSE_FLOAT32=ON ..\n```\n\n## How to run samples\n\nFirst, extract input graph files.\n\n```\n$ cd cuda-bundle-adjustment/samples\n$ 7za x ba_input.7z\n```\n\nInput Filename|Description\n---|---\nba_kitti_07.json|graph components sampled from `KITTI sequences/07` using [ORB-SLAM2](https://github.com/raulmur/ORB_SLAM2)\nba_kitti_00.json|graph components sampled from `KITTI sequences/00` using [ORB-SLAM2](https://github.com/raulmur/ORB_SLAM2)\n\nThen, pass to the sample code.\n\n```\n$ cd cuda-bundle-adjustment/build\n$ ./samples/sample_ba_from_file ../samples/ba_input/ba_kitti_00.json\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eoutput example of sample_ba_from_file\u003c/summary\u003e\n\n```\n$ ./samples/sample_ba_from_file ../samples/ba_input/ba_kitti_00.json\n\nReading Graph... Done.\n\n=== Graph size :\nnum poses      : 1322\nnum landmarks  : 133383\nnum edges      : 561116\n\nRunning BA... Done.\n\n=== Processing time :\nBA total : 1.22[sec]\n\n0: Initialize Optimizer        :     67.9[msec]\n1: Build Structure             :     69.1[msec]\n2: Compute Error               :     11.0[msec]\n3: Build System                :     50.4[msec]\n4: Schur Complement            :    106.2[msec]\n5: Symbolic Decomposition      :    353.8[msec]\n6: Numerical Decomposition     :    554.5[msec]\n7: Update Solution             :      1.2[msec]\n\n=== Objective function value :\niter:  1, chi2: 334210.0\niter:  2, chi2: 331822.8\niter:  3, chi2: 329700.4\niter:  4, chi2: 327743.4\niter:  5, chi2: 326123.2\niter:  6, chi2: 324876.6\niter:  7, chi2: 323698.5\niter:  8, chi2: 322572.7\niter:  9, chi2: 321410.3\niter: 10, chi2: 320086.4\n```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eoutput example of sample_comparison_with_g2o\u003c/summary\u003e\n\n```\n$ ./samples/sample_comparison_with_g2o ../samples/ba_input/ba_kitti_00.json\n\nReading Graph... Done.\n\n=== Graph size :\nnum poses      : 1322\nnum landmarks  : 133383\nnum edges      : 561116\n\nRunning BA with CPU... Done.\n\nRunning BA with GPU... Done.\n\n=== Processing time :\nCPU :   11.93 [sec]\nGPU :    1.23 [sec]\n\n=== Objective function value :\n iteration|  chi2 CPU|  chi2 GPU\n         1|  334210.0|  334210.0\n         2|  331822.8|  331822.8\n         3|  329700.4|  329700.4\n         4|  327743.4|  327743.4\n         5|  326123.2|  326123.2\n         6|  324876.6|  324876.6\n         7|  323698.5|  323698.5\n         8|  322572.7|  322572.7\n         9|  321410.3|  321410.3\n        10|  320086.4|  320086.4\n\n=== RMSE between CPU estimates and GPU estimates :\nRotation    : 7.63e-16\nTranslation : 4.50e-13\nLandmark    : 4.50e-13\n```\n\u003c/details\u003e\n\n## Author\nThe \"adaskit Team\"  \n\nThe adaskit is an open-source project created by [Fixstars Corporation](https://www.fixstars.com/) and its subsidiary companies including [Fixstars Autonomous Technologies](https://at.fixstars.com/), aimed at contributing to the ADAS industry by developing high-performance implementations for algorithms with high computational cost.\n\n## License\nApache License 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffixstars%2Fcuda-bundle-adjustment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffixstars%2Fcuda-bundle-adjustment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffixstars%2Fcuda-bundle-adjustment/lists"}