{"id":50773674,"url":"https://github.com/aposb/stereo-algorithms-evolution","last_synced_at":"2026-06-11T21:31:17.128Z","repository":{"id":360715382,"uuid":"1248362872","full_name":"aposb/stereo-algorithms-evolution","owner":"aposb","description":"Evolution of Basic Stereo Matching Algorithms. From Block Matching and Dynamic Programming to Semi-Global Matching and Belief Propagation. Compare the source code to see the improvements.","archived":false,"fork":false,"pushed_at":"2026-06-04T18:11:07.000Z","size":533,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-04T19:09:26.065Z","etag":null,"topics":["belief-propagation","block-matching","block-matching-algorithm","computer-vision","disparity-map","dynamic-programming","dynamic-programming-algorithm","loopy-belief-propagation","semi-global-matching","sgm","stereo-matching","stereo-vision"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aposb.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-24T14:45:49.000Z","updated_at":"2026-06-04T18:04:58.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/aposb/stereo-algorithms-evolution","commit_stats":null,"previous_names":["aposb/stereo-algorithms-evolution"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aposb/stereo-algorithms-evolution","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aposb%2Fstereo-algorithms-evolution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aposb%2Fstereo-algorithms-evolution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aposb%2Fstereo-algorithms-evolution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aposb%2Fstereo-algorithms-evolution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aposb","download_url":"https://codeload.github.com/aposb/stereo-algorithms-evolution/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aposb%2Fstereo-algorithms-evolution/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34219510,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-11T02:00:06.485Z","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":["belief-propagation","block-matching","block-matching-algorithm","computer-vision","disparity-map","dynamic-programming","dynamic-programming-algorithm","loopy-belief-propagation","semi-global-matching","sgm","stereo-matching","stereo-vision"],"created_at":"2026-06-11T21:31:15.287Z","updated_at":"2026-06-11T21:31:17.123Z","avatar_url":"https://github.com/aposb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Basic Stereo Algorithms (Evolution)\n\nThe basic stereoscopic algorithms have many similarities to each other and can be considered, in a way, that each algorithm is an evolution of another. In this project we created simplified forms of some basic stereoscopic algorithms in MATLAB and Python. The code has been adapted to show the improvement and evolution of an algorithm from the previous one. Compare the source code to see the improvements.\n\n## Features\n\nStereo matching algorithms:\n\n1. **Block Matching**\n2. **Dynamic Programming**\n3. **Semi-Global Matching**\n4. **Belief Propagation (Directional)**\n5. **Belief Propagation (Synchronous)**\n\nTwo different approaches to calculating smoothness costs.\n\nAll algorithms are implemented in both MATLAB and Python.\n\nThe algorithms are optimized for performance using matrix operations and other techniques.\n\n## Algorithms\n\n### Approach A\nUses a function to calculate the smoothness cost (BP-Like).\n\n| Number | Name | MATLAB Implementation | Python Implementation |\n| --- | --- | --- | --- |\n| 1 | Block Matching | **[`stereo1_BM.m`](./matlab/stereo1_BM.m)** | **[`stereo1_BM.py`](./python/stereo1_BM.py)** |\n| 2 | Dynamic Programming | **[`stereo2_DP.m`](./matlab/stereo2_DP.m)** | **[`stereo2_DP.py`](./python/stereo2_DP.py)** |\n| 3 | Semi-Global Matching | **[`stereo3_SGM.m`](./matlab/stereo3_SGM.m)** | **[`stereo3_SGM.py`](./python/stereo3_SGM.py)** |\n| 4 | Belief Propagation (Directional) | **[`stereo4_BP1.m`](./matlab/stereo4_BP1.m)** | **[`stereo4_BP1.py`](./python/stereo4_BP1.py)** |\n| 5 | Belief Propagation (Synchronous) | **[`stereo5_BP2.m`](./matlab/stereo5_BP2.m)** | **[`stereo5_BP2.py`](./python/stereo5_BP2.py)** |\n\n### Approach B\nUses the parameters p1 and p2 to set occlusion penalties (SGM-Like).\n\n| Number | Name | MATLAB Implementation | Python Implementation |\n| --- | --- | --- | --- |\n| 1 | Block Matching | **[`stereo1_BM.m`](./matlab/stereo1_BM.m)** | **[`stereo1_BM.py`](./python/stereo1_BM.py)** |\n| 2 | Dynamic Programming | **[`stereo2b_DP.m`](./matlab/stereo2b_DP.m)** | **[`stereo2b_DP.py`](./python/stereo2b_DP.py)** |\n| 3 | Semi-Global Matching | **[`stereo3b_SGM.m`](./matlab/stereo3b_SGM.m)** | **[`stereo3b_SGM.py`](./python/stereo3b_SGM.py)** |\n| 4 | Belief Propagation (Directional) | **[`stereo4b_BP1.m`](./matlab/stereo4b_BP1.m)** | **[`stereo4b_BP1.py`](./python/stereo4b_BP1.py)** |\n| 5 | Belief Propagation (Synchronous) | **[`stereo5b_BP2.m`](./matlab/stereo5b_BP2.m)** | **[`stereo5b_BP2.py`](./python/stereo5b_BP2.py)** |\n\n## Installation\n\nDownload the project as ZIP file, unzip it, and run the scripts.\n\n### Python Requirements\n\n- NumPy\n- Matplotlib\n- OpenCV (`opencv-python`)\n\n## Usage\n\nA stereo matching algorithm works with stereo image pairs to produce disparity maps.\nThis project contains MATLAB and Python scripts, each implementing a stereo matching algorithm. The files `left.png` and `right.png` contain the stereo image pair used as input.\nTo use a different stereo pair, replace these two images with your own. In this case, you must also adjust the **disparity levels** parameter in the script you are running.\nYou may optionally modify other parameters as needed. If the input images contain little or no noise, it is recommended not to use the Gaussian filter.\n\n- The results between MATLAB and Python implementation are similar.\n- The two different approaches produce same results.\n\n## Results\n\nBelow are the disparity maps produced from the **Tsukuba stereo pair**.\n\n![Tsukuba Left](matlab/left.png) ![Tsukuba Right](matlab/right.png)\n\n### Block Matching\n\n![Block Matching (SAD) Disparity Map](results/disparity1_BM.png)\n\n### Dynamic Programming\n\n![Dynamic Programming (Left-Right) Disparity Map](results/disparity2_DP.png)\n\n### Semi-Global Matching\n\n![Semi-Global Matching Disparity Map](results/disparity3_SGM.png)\n\n### Belief Propagation (Directional)\n\n![Belief Propagation (Directional) Disparity Map](results/disparity4_BP1.png)\n\n### Belief Propagation (Synchronous)\n\n![Belief Propagation (Synchronous) Disparity Map](results/disparity5_BP2.png)\n\n## Links\n\n### Project Repository\n- [Basic Stereo Algorithms (Evolution)](https://github.com/aposb/stereo-algorithms-evolution)\n\n### Related Projects\n- [Stereo Matching Algorithms in MATLAB and Python](https://github.com/aposb/stereo-matching-algorithms)\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faposb%2Fstereo-algorithms-evolution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faposb%2Fstereo-algorithms-evolution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faposb%2Fstereo-algorithms-evolution/lists"}