{"id":29895558,"url":"https://github.com/raphaelsenn/horn-schunck","last_synced_at":"2025-08-01T07:21:03.978Z","repository":{"id":306493623,"uuid":"1026205798","full_name":"raphaelsenn/horn-schunck","owner":"raphaelsenn","description":"Simple C++ implementation of Horn-Schunck optical flow using OpenCV. ","archived":false,"fork":false,"pushed_at":"2025-07-25T20:25:36.000Z","size":68292,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-26T02:39:07.571Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/raphaelsenn.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}},"created_at":"2025-07-25T13:38:28.000Z","updated_at":"2025-07-25T20:25:41.000Z","dependencies_parsed_at":"2025-07-26T02:57:36.055Z","dependency_job_id":null,"html_url":"https://github.com/raphaelsenn/horn-schunck","commit_stats":null,"previous_names":["raphaelsenn/horn-schunck"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/raphaelsenn/horn-schunck","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fhorn-schunck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fhorn-schunck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fhorn-schunck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fhorn-schunck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphaelsenn","download_url":"https://codeload.github.com/raphaelsenn/horn-schunck/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsenn%2Fhorn-schunck/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268185548,"owners_count":24209387,"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","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"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":[],"created_at":"2025-08-01T07:20:59.461Z","updated_at":"2025-08-01T07:21:03.966Z","avatar_url":"https://github.com/raphaelsenn.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# horn-schunck\nSimple C++ implementation of Horn-Schunck optical flow using OpenCV. \n\n**Note:**  \nThis implementation is written with a focus on clarity and mathematical transparency rather than low-level optimizations.  \nBut it should run in real-time on any CPU \u003e then the year 2010.\n\nThe original paper can be found here: [Determining optical flow](https://www.sciencedirect.com/science/article/abs/pii/0004370281900242)\n\n![dense_optical_flow_gif](./assets/dense_optical_flow.gif)\n\n*Showing dense (hue) optical flow using horn-schunck method; Raw video taken from https://www.youtube.com/watch?v=zOq2XdwHGT0*\n\n![sparse_optical_flow_gif](./assets/sparse_optical_flow.gif)\n\n*Showing dense optical flow using horn-schunck method; Raw video taken from https://www.youtube.com/watch?v=zOq2XdwHGT0*\n\nWe calculate the optical flow by minimizing the energy in Equation (1).\nFor more details, see the [Horn-Schunck method](https://en.wikipedia.org/wiki/Horn%E2%80%93Schunck_method) on Wikipedia.\n\n![energy_horn_schunck](./assets/energy_horn_schunck.png)\n*Equation (1); Taken from https://en.wikipedia.org/wiki/Horn%E2%80%93Schunck_method*\n\n## Usage\nOpenCV, CMake, Make (and a compiler :D) is assumed to be installed.\n\n(1) The CMakeLists.txt should look like this:\n\n```cmake\ncmake_minimum_required(VERSION 3.5)\nproject( horn-schunck )\nfind_package( OpenCV REQUIRED )\ninclude_directories( ${OpenCV_INCLUDE_DIRS} )\nadd_executable( run run.cpp src/horn_schunck.cpp )\ntarget_link_libraries( run ${OpenCV_LIBS} )\n```\n\n(2) Generate the executable, make sure your in the repository folder.\n```bash\ncmake .\nmake\n```\n\n(3.1) Run with internal webcam (if available; press any key to quit):\n```bash\n./run\n```\n\n(3.2) Run with video from file (press any key to quit):\n```bash\n./run your_video.avi\n```\n\n## Citations\n```bibtex\n@article{HORN1981185,\ntitle = {Determining optical flow},\njournal = {Artificial Intelligence},\nvolume = {17},\nnumber = {1},\npages = {185-203},\nyear = {1981},\nissn = {0004-3702},\ndoi = {https://doi.org/10.1016/0004-3702(81)90024-2},\nurl = {https://www.sciencedirect.com/science/article/pii/0004370281900242},\nauthor = {Berthold K.P. Horn and Brian G. Schunck},\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsenn%2Fhorn-schunck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphaelsenn%2Fhorn-schunck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsenn%2Fhorn-schunck/lists"}