{"id":16360082,"url":"https://github.com/frgfm/video-mender","last_synced_at":"2026-05-16T17:14:34.805Z","repository":{"id":110056811,"uuid":"251329934","full_name":"frgfm/video-mender","owner":"frgfm","description":"Serving your favorite mending charm for videos","archived":false,"fork":false,"pushed_at":"2020-03-30T20:55:24.000Z","size":7401,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-01T08:02:02.445Z","etag":null,"topics":["computer-vision","denoising","opencv","python","video-processing"],"latest_commit_sha":null,"homepage":"https://frgfm.github.io/video-mender/","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/frgfm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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-03-30T14:27:08.000Z","updated_at":"2020-03-30T20:55:01.000Z","dependencies_parsed_at":"2023-05-20T21:00:34.052Z","dependency_job_id":null,"html_url":"https://github.com/frgfm/video-mender","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/frgfm/video-mender","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frgfm%2Fvideo-mender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frgfm%2Fvideo-mender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frgfm%2Fvideo-mender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frgfm%2Fvideo-mender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/frgfm","download_url":"https://codeload.github.com/frgfm/video-mender/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/frgfm%2Fvideo-mender/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33111508,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["computer-vision","denoising","opencv","python","video-processing"],"created_at":"2024-10-11T02:10:30.423Z","updated_at":"2026-05-16T17:14:34.787Z","avatar_url":"https://github.com/frgfm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Video Mender\n[![License](https://img.shields.io/badge/License-MIT-brightgreen.svg)](LICENSE)  [![Codacy Badge](https://api.codacy.com/project/badge/Grade/f6ee2d6a33054c0c8f8bed556cbfdfe1)](https://www.codacy.com/manual/frgfm/video-mender?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=frgfm/video-mender\u0026amp;utm_campaign=Badge_Grade)  ![Build Status](https://github.com/frgfm/video-mender/workflows/python-package/badge.svg) [![Docs](https://img.shields.io/badge/docs-available-blue.svg)](https://frgfm.github.io/video-mender)  \n\nImplementation of a frame denoising and reordering algorithm for video sequences.\n\n|             Noisy unordered sample              |                    Restored sample                    |\n| :---------------------------------------------: | :---------------------------------------------------: |\n| ![noisy_sample](static/images/noisy_sample.gif) | ![restored_sample](static/images/restored_sample.gif) |\n\n\n\n\u003e The **Mending Charm**,[[1\\]](https://harrypotter.fandom.com/wiki/Mending_Charm#cite_note-POT-0) also known as the **Repairing Charm**[[2\\]](https://harrypotter.fandom.com/wiki/Mending_Charm#cite_note-WON-1) (*Reparo*), is a [charm](https://harrypotter.fandom.com/wiki/Charm) that can be used to seamlessly repair a broken object and works on most materials.\n\n*Source: Harry Potter Wiki*\n\n\n\n## Table of Contents\n\n- [Getting Started](#getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n- [Usage](#usage)\n- [Technical Roadmap](#technical-roadmap)\n- [Documentation](#documentation)\n- [Contributing](#contributing)\n- [Credits](#credits)\n- [License](#license)\n\n\n\n## Getting started\n\n### Prerequisites\n\n- Python 3.6 (or more recent)\n- [pip](https://pip.pypa.io/en/stable/)\n\n### Installation\n\nYou can install the package as follows:\n\n```shell\ngit clone https://github.com/frgfm/video-mender.git\npip install -e video-mender/.\n```\n\n\n\n## Usage\n\nYou can find an example below to process a video\n\n```bash\npython scripts/restore.py \u003cPATH_TO_YOUR_VIDEO\u003e --outfile \u003cOUTPUT_FILE\u003e --chain-denoise\n```\n\n\n\n## Approach\n\n### Removing extra noisy frames\n\nAs suggested by this [article](https://www.pyimagesearch.com/2014/07/14/3-ways-compare-histograms-using-opencv-python/), histogram comparison is one way to spot outliers in a frame dataset. Here we assume that some extra unrelated frames can be added to the processed sample.\n\n![hist_correlation](static/images/hist_correlation.png)\n\nIn this example, there is at least a frame with a correlation above 0.8 but that seems to be distant from the median distribution. However, to be able to generalize, we will set our threshold to `0.65` to handle cases where valid frames have a flatter distribution in terms of correlation.\n\n\n\n### Restoring order\n\nHere we will use a codistance matrix to compare frames. Using this method, we can easily avoid the histogram method for outlier filtering.\n\nWithin a common shot, with the consecutive frames A --\u003e B --\u003e C --\u003e D, we expect the distance between consecutive as being lower than with distant frames. On a first pass, we take the first unordered frame and iteratively take the best match.\n\n![consec_dist_denoise](static/images/consec_dist_denoise.png)\n\nThe above shows that this process already provides some structured order, but some frames seem to be unrelated to the original video or to be really badly ordered. Here we remove frames with consecutive cosine distance higher than 5 times the median value, which yields the following:\n\n![consec_distance_split](static/images/consec_distance_split.png)\n\nNow there seems to be only one consecutive cosine distance higher than the others. Here we made our first pass assuming we started with the first frame, which is not likely to be the case. So this remaining outlier is most likely the split between the end of the sequence starting with our uneducated guess.\n\nUsing our chaining process again starting from this frame ends up giving promising results.\n\n\n\n## Technical roadmap\n\nThe project is currently under development, here are the objectives for the next releases:\n\n- [x] Frame processing: process the video frames.\n- [ ] Audio processing: use the matching performed on frames to write audio to output as well.\n- [ ] Benchmark: add a benchmark of multiple methods.\n\n\n\n## Documentation\n\nThe full package documentation is available [here](https://frgfm.github.io/video-mender/) for detailed specifications. The documentation was built with [Sphinx](sphinx-doc.org) using a [theme](github.com/readthedocs/sphinx_rtd_theme) provided by [Read the Docs](readthedocs.org).\n\n\n\n## Contributing\n\nPlease refer to `CONTRIBUTING` if you wish to contribute to this project.\n\n\n\n## Credits\n\nThis project is developed and maintained by the repo owner, but the implementation was based on the following precious papers:\n\n- [Histogram comparison article](https://www.pyimagesearch.com/2014/07/14/3-ways-compare-histograms-using-opencv-python/): ways to compare picture histograms using OpenCV\n- [Scipy](https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.cdist.html): scientific computation library for python. \n\n\n\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrgfm%2Fvideo-mender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffrgfm%2Fvideo-mender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffrgfm%2Fvideo-mender/lists"}