{"id":19855835,"url":"https://github.com/cuixing158/visual-based-odometry-estimation2","last_synced_at":"2026-05-14T12:34:38.172Z","repository":{"id":257522044,"uuid":"858523498","full_name":"cuixing158/Visual-Based-Odometry-Estimation2","owner":"cuixing158","description":"Stitching and fusion of on-board surround view BEV real world image sequences, odometer estimation and output of large pixel map","archived":false,"fork":false,"pushed_at":"2025-02-02T04:38:57.000Z","size":13454,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-04T19:47:18.018Z","etag":null,"topics":["algorithms","bev","bof","computer-vision","dbow","image-processing","image-similarity","matlab","mex","odometry","opencv","orb","stiches"],"latest_commit_sha":null,"homepage":"","language":"MATLAB","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cuixing158.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"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},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":"https://raw.githubusercontent.com/cuixing158/OpticalFlow-Visualization/refs/heads/main/README_media/sponsors.jpg"}},"created_at":"2024-09-17T03:42:39.000Z","updated_at":"2025-05-12T14:14:13.000Z","dependencies_parsed_at":"2025-01-11T13:48:26.883Z","dependency_job_id":"8f84a409-eba9-43f0-8c9d-9e1127a4ef77","html_url":"https://github.com/cuixing158/Visual-Based-Odometry-Estimation2","commit_stats":null,"previous_names":["cuixing158/visual-based-odometry-estimation2"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cuixing158/Visual-Based-Odometry-Estimation2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuixing158%2FVisual-Based-Odometry-Estimation2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuixing158%2FVisual-Based-Odometry-Estimation2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuixing158%2FVisual-Based-Odometry-Estimation2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuixing158%2FVisual-Based-Odometry-Estimation2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cuixing158","download_url":"https://codeload.github.com/cuixing158/Visual-Based-Odometry-Estimation2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuixing158%2FVisual-Based-Odometry-Estimation2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33025151,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["algorithms","bev","bof","computer-vision","dbow","image-processing","image-similarity","matlab","mex","odometry","opencv","orb","stiches"],"created_at":"2024-11-12T14:13:50.358Z","updated_at":"2026-05-14T12:34:38.151Z","avatar_url":"https://github.com/cuixing158.png","language":"MATLAB","funding_links":["https://raw.githubusercontent.com/cuixing158/OpticalFlow-Visualization/refs/heads/main/README_media/sponsors.jpg"],"categories":[],"sub_categories":[],"readme":"# Visual-Based Odometry Estimation2\n\n[![Sponsor](https://img.shields.io/badge/-Sponsor-red?style=for-the-badge\u0026logo=GitHub-Sponsors\u0026logoColor=white)](https://raw.githubusercontent.com/cuixing158/OpticalFlow-Visualization/refs/heads/main/README_media/sponsors.jpg)\n[![View Visual-Based-Odometry-Estimation2 on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/172820-visual-based-odometry-estimation2)\n\nThis repo is an enhanced version of [Visual-Based Odometry Estimation](https://github.com/cuixing158/Visual-Based-Odometry-Estimation). In addition to supporting the existing features(following Features), it adds loop detection and graph optimization, supports efficient C/C++ code generation, allows for [deep customization with a C++ OpenCV MEX interface, and enables hybrid programming](./codegen_custom_cpp/README.md)!\n\n## Features\n\n- Real-time application construction without the need to predefine the map size\n- Pixel maps correspond directly to physical maps, facilitating easy query and localization\n- Based on pure image algorithm only (no IMU, GPS, WheelEncoder, etc. to assist).\n- Supports embedded C/C++ code generation\n\n## Requirements\n\nMathWorks Products(\u003cwww.mathworks.com\u003e)\n\n- MATLAB® R2022b or later\n- Computer Vision Toolbox™\n- Image Processing Toolbox™\n- Navigation Toolbox™\n\nOpen C++ Library:\n\n- OpenCV 4.x（Open Source Computer Vision Library）\n\nComplier\n\n- C++ Compiler (e.g., GCC, Clang, or MSVC)\n\n## Loop closure detection and optimization\n\n姿态图节点图优化:\u003cbr\u003e\n\n![poseGraphOptim](./images/loopClosurePose.jpg)\n\n全局像素图像优化前:\u003cbr\u003e\n\n![beforeOptim](./images/beforeOptim.png)\n\n全局像素图像优化后:\u003cbr\u003e\n\n![afterOptim](./images/afterOptim.png)\n\n集成的DBOW3使用MATLAB的ORB特征，检索效果略好于matlab build-in 的bof。为便于对比，算法设置同样的参数配置，top9 view,queryID分别选取283、300、2087与上述进行对比。\n\n测试基准：使用MATLAB内建函数`detectORBFeatures`和`extractFeatures`默认设置的结果特征输入给原始DBOW3，每张图片提取的特征数定固定为为尽可能多(HXW，一般典型特征点数量5000左右)，无均匀处理。2687张480x640图片提取的词袋特征耗时17min左右！\n\nqueryID=283，DBOW3表现,同样，绿色框为re-ranking的最佳选择：\u003cbr\u003e\n![bof1](./images/DBOW3_matlab_orbFeatures_add_queryIdx283.jpg)\n\nqueryID=300，DBOW3表现,同样，绿色框为re-ranking的最佳选择：\u003cbr\u003e\n![bof1](./images/DBOW3_matlab_orbFeatures_add_queryIdx300.jpg)\n\nqueryID=2087，DBOW3表现,同样，绿色框为re-ranking的最佳选择：\u003cbr\u003e\n![bof1](./images/DBOW3_matlab_orbFeatures_add_queryIdx2087.jpg)\n\n*另外关于loopClosure运作机理详细情况请参阅[窥探loop closure姿态图优化的运作机理](./loopClosureAnalyze.md)*。\n\n## Performance\n\n硬件：4 cores,Intel(R) Xeon(R) Gold 6226 CPU @ 2.70GHz,754G RAM \u003cbr\u003e\n软件：Ubuntu20.04,MATLAB R2023a,OpenCV 4.6.0\u003cbr\u003e\n\n### 词袋生成性能\n\nbenchmark: 使用最初提供的的$480\\times640$大小灰度图像,共2687张图像,典型每张图像最多能检测到4000~5000个orb特征点。\n\n- OpenCV内建函数`detectAndCompute`的ORB特征检测器除了`numFeatures`参数其他均按照默认设置\n- MATLAB内建函数`detectORBFeatures`和`extractFeatures`使用同OpenCV的默认设置\n\n分别在[本2D SLAM主模块](./constructWorldMap.m)中将提取到的ORB特征输入给原始C++版本的DBOW3,测试生成词袋特征性能和最相似分数分布，见下表。\n\n|                                                  | #Max features(numFeatures)   | Time consuming generation of database.yml.gz | Most similarity score distribution(mode) |\n| :----------------------------------------------: | :-------------: | :-------------: | :-------------:  |\n| DBOW3(opencv extract image features input)       | 2000            | \u003e7.15min        | 0.2              |\n| DBOW3(MATLAB extract image features input)       | 1000            | 3.3min          | 0.17             |\n| DBOW3(MATLAB extract image features input)       | 2000            | 7.15min         | 0.2              |\n| DBOW3(MATLAB extract image features input)       | all             | 17min           |0.4               |\n\n从上表可知：生成词袋特征耗时主要受到`#Max features(numFeatures)`因素的影响，这主要是因为特征较多时候，创建视觉单词计算量较大，聚类，TF-IDF都会受到影响，相似性分数分布普遍较高，符合我们直观感受。可根据实际情况斟酌选用组合。\n\n### 数据序列化/反序列化性能\n\n对于MATLAB结构体数据序列化/反序列化，支持针对**任意通用**MATLAB结构体数据结构，不依赖具体的数据类型，并认真做了实践比较，参考见下表：\n\n|  serializers                      | Size   | Load Avg Time(sec) | Save Avg Time(sec) |\n| :--------------------: | :-------------: | :-------------: | :-------------:  |\n| [opencv(yml.gz)](https://docs.opencv.org/4.6.0/dd/d74/tutorial_file_input_output_with_xml_yml.html)      | 145M           | 17.27          | 25.52              |\n| [cereal(binary)](http://uscilab.github.io/cereal/index.html)      | 110M            | 0.49        | 0.51              |\n| [boost](https://www.boost.org/doc/libs/1_72_0/libs/serialization/doc/tutorial.html)      | 待测            | 待测        | 待测              |\n| [matlab内置(mat)](https://www.mathworks.com/help/matlab/import_export/mat-file-versions.html)       | 84M            | 0.76          | 5.06             |\n| 自己方法实现的       | 110M            | 0.42         |  0.43              |\n\n```C++\ntypedef struct imageViewSt {\n    cv::Mat descriptors;\n    std::vector\u003ccv::Point2d\u003e keyPoints;\n} imageViewSt;\n```\n\n与之对应MATLAB数据结构体imageViewSt为\n\n```text\nstruct array with fields:\n    Features\n    Points\n```\n\n存储数据设计为含有1198个结构体的数组，每个结构体有两个域段`Features`和`Points`，其`Features`为$2000\\times32$大小的uint8数据，`Points`为$2000\\times2$大小的double数据，在C++和MATLAB环境下数据类型和大小均保持一致！测试脚本见[unitTestSuitsAndBenchMark](./utils/unitTestSuitsAndBenchMark.m)和[cereal_benchmark](https://github.com/cuixing158/DBOW3/utils/demo_cereal_bench.cpp)。关于boost未测，但可参考[此处](https://github.com/thekvs/cpp-serializers)间接比较。\n\n## Function Dependency Graph\n\n![graph](./images/dependency.JPG)\n\n## Image Localization\n\n利用已经建好的地图，加载视觉特征，然后随机给定一定位图片，定位效果图如下：\u003cbr\u003e\n![orb_performance](./images/location.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuixing158%2Fvisual-based-odometry-estimation2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuixing158%2Fvisual-based-odometry-estimation2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuixing158%2Fvisual-based-odometry-estimation2/lists"}