{"id":26222192,"url":"https://github.com/walles/find_bad_motion_tracks","last_synced_at":"2025-07-22T23:04:12.817Z","repository":{"id":44966810,"uuid":"391267849","full_name":"walles/find_bad_motion_tracks","owner":"walles","description":"Finds bad tracks when doing motion tracking in Blender","archived":false,"fork":false,"pushed_at":"2024-08-22T16:51:54.000Z","size":2296,"stargazers_count":23,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-19T08:15:54.767Z","etag":null,"topics":["blender","blender-addon","motiontracking"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/walles.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":"2021-07-31T05:52:33.000Z","updated_at":"2024-08-22T16:51:58.000Z","dependencies_parsed_at":"2024-08-22T18:51:35.724Z","dependency_job_id":null,"html_url":"https://github.com/walles/find_bad_motion_tracks","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/walles/find_bad_motion_tracks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walles%2Ffind_bad_motion_tracks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walles%2Ffind_bad_motion_tracks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walles%2Ffind_bad_motion_tracks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walles%2Ffind_bad_motion_tracks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/walles","download_url":"https://codeload.github.com/walles/find_bad_motion_tracks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/walles%2Ffind_bad_motion_tracks/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266586905,"owners_count":23952205,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["blender","blender-addon","motiontracking"],"created_at":"2025-03-12T16:51:31.548Z","updated_at":"2025-07-22T23:04:12.789Z","avatar_url":"https://github.com/walles.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![tox](https://github.com/walles/find_bad_motion_tracks/actions/workflows/main.yml/badge.svg)](https://github.com/walles/find_bad_motion_tracks/actions/workflows/main.yml)\n\n# Find Bad Motion Tracks\n\nThis is a [Blender](https://blender.org)\n[addon](https://docs.blender.org/manual/en/latest/editors/preferences/addons.html)\nfor finding bad [motion tracking\ntracks](https://docs.blender.org/manual/en/latest/movie_clip/tracking/clip/editing/track.html).\n\nThe way it works is that it highlights tracks that move differently from the\nothers.\n\nBasically, if all tracks move to the right, except one that moves to the left,\nthen the single track moving to the left is likely wrong and should be evaluated\nby a human.\n\n![Example usage](example.png 'Example usage')\n\n## Installation Instructions\n\n1. Go to the [latest release download page](https://github.com/walles/find_bad_motion_tracks/releases/latest)\n1. Download the `find_bad_tracks-A_B_C.py` file\n1. In Blender, open Preferences (under the \u003ckbd\u003eEdit\u003c/kbd\u003e menu)\n1. Click \u003ckbd\u003eAdd-ons\u003c/kbd\u003e\n1. Click the \u003ckbd\u003eInstall...\u003c/kbd\u003e button\n1. Find the file you just downloaded and click \u003ckbd\u003eInstall Add-on\u003c/kbd\u003e\n1. Check the box next to \u003ckbd\u003eVideo Tools: Find Bad Tracks\u003c/kbd\u003e\n\n## Usage Instructions\n\n1. Follow the Installation Instructions `^` for how to install and enable this addon\n\n1. Do some motion tracking, collect some tracks\n\n1. In the Motion Tracking workspace, Movie Clip Editor on the middle left of\n   your screen, select the \u003ckbd\u003eTrack\u003c/kbd\u003e tab, expand \u003ckbd\u003eFind Bad\n   Tracks\u003c/kbd\u003e (you may have to scroll down to see this section) and press the\n   \u003ckbd\u003eFind Bad Tracks\u003c/kbd\u003e button.\n\n   At about 400 tracks and 600 frames the computation takes 5s-10s on my\n   machine.\n\n1. A list of Bad Tracks will now be displayed just below that button, with each\n   track's badness score next to it.\n\n   Clicking a track in the list will select that track in the clip editor and\n   take you to the worst frame. Stepping a few frames left or right will show\n   how the track skips / slides.\n\n1. Another list of Duplicate Tracks comes below the Bad Tracks list. This list\n   contains track pairs that come close at some point of their lifetimes. The\n   most divergent track pairs are at the top of this list.\n\n   At the bottom of the list you will find tracks that overlap tightly without\n   diverging.\n\n   Clicking a track pair in this list will take you to a frame where the tracks\n   overlap. Stepping a few frames left or right will show you if the tracks\n   start diverging. If they do, (at least) one of the tracks are likely bad!\n\n# Comparison to Built-in Functionality\n\nFind Bad Tracks is similar to the built-in [Filter\nTracks](https://docs.blender.org/manual/en/latest/movie_clip/tracking/clip/editing/track.html#filter-tracks)\nfunctionality ([source](https://github.com/blender/blender/blob/04c75c5ce7699a1502a7c2212d4aa57166465514/release/scripts/startup/bl_operators/clip.py#L141-L215)).\n\n\u003c!-- Table generated by https://www.tablesgenerator.com/markdown_tables --\u003e\n\n|                             | Find Bad Tracks                                                                                                                          | Filter Tracks                                                                                                                   |\n| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |\n| Finding the midpoint        | :green_heart: Uses median, resilient to outliers                                                                                         | :broken_heart: Uses average, sensitive to outliers                                                                              |\n| Threshold                   | :green_heart: N/A, calculates a badness value based on the 80th percentile of track movements, works on both fast and slow moving frames | :broken_heart: 5 pixels, too sensitive on fast moving frames, too lenient on slow moving frames                                 |\n| Uses derivative             | :green_heart:                                                                                                                            | :green_heart:                                                                                                                   |\n| Uses 2nd derivative         | :green_heart:                                                                                                                            | :broken_heart: No, which means the Filtering will miss tracks which suddenly move in a new direction                            |\n| Tracks marker shape changes | :green_heart:                                                                                                                            | :broken_heart:                                                                                                                  |\n| Presentation                | :green_heart: List tracks ranked by badness, lets user filter                                                                            | :broken_heart: Just selects all \"bad\" tracks, in my case that included lots of good tracks making the signal-to-noise ratio bad |\n| Finds duplicate tracks      | :green_heart:                                                                                                                            | :broken_heart:                                                                                                                  |\n\n## Development\n\nUse [`tox`](https://tox.wiki/en/latest/install.html) to verify your code before\ncommitting / PRing:\n\n```\ntox\n```\n\n### Testing Locally in Blender\n\nThese are first-time instructions. For the second go, you can just regenerate\nthe plugin and install it from disk again in the Blender Preferences. This will\nreplace the currently installed version with the new one.\n\n1. `./package-versioned-zip.sh 99.99.99`\n1. Start Blender and pick \"VFX\" under \"New File\"\n1. Install the addon from `find-bad-motion-tracks-99_99_99.zip`:\n   - Edit -\u003e\n   - Preferences -\u003e\n   - Extensions -\u003e\n   - Click the unlabeled Extension Settings dropdown button on the right -\u003e\n   - Install from Disk -\u003e\n1. Make some tracks to test with\n   1. In the Motion Tracking workspace (you should already be there), click the\n      Open button in the middle of the screen and load some video clip\n   1. Click the \"Detect Features\" button on the left\n   1. Under Track, click the \"Track the selected markers forward for the entire\n      clip\" button\n1. Scroll down to the Find Bad Tracks section and click the \"Find Bad Tracks\"\n   button\n\n### Development Environment\n\nI have developed this with:\n\n- [Visual Studio Code](https://code.visualstudio.com/) with its [Blender Development\n  extension](https://marketplace.visualstudio.com/items?itemName=JacquesLucke.blender-development)\n- The [Fake Blender Python API module collection](https://github.com/nutti/fake-bpy-module) in a virtualenv\n- Blender 2.93.1\n\n### Icon\n\nTo edit the icon, first update [`icon.blend`](icon.blend). Then render the\nupdated icon into [`icon.png`](icon.png).\n\n![Icon](icon.png)\n\n## Making a New Release\n\n1. Make sure the screenshot and description ^ are both up to date and in sync.\n1. Run `release.sh` and follow instructions.\n\n## TODO\n\n- Fix the tracks list tooltips, the current ones make no sense: \"Active Bad\n  Track / Double click to rename.\"\n- Profile and see what can easily be sped up\n- Publish on Blender Market\n\n## Next Gen\n\nThe current badness algorithm works well when all tracks move in the same\ndirection (camera pans).\n\nBut doesn't work at all when the camera zooms or rotates.\n\nWhat about this then?\n\n1. Compute the (2D) transformation matrix between two frames\n1. For each marker, check how far it is from its computed value given that\n   matrix\n\nThat should work for zooming and rotating camera motion as well. Also, we could\ncheck the whole matrix and see if it makes sense, if the whole image just gets\nnarrower for example that's probably wrong.\n\nInspirational code here: \u003chttps://stackoverflow.com/a/20555267/473672\u003e\n\n### DONE\n\n- Document a release process\n- Make an initial release\n- Document install instructions higher up in this document\n- Ignore locked tracks, assuming they have been manually vetted by a human\n- Announce on BlenderNation\n- Fix user reported issues\n- Add duplicate tracks detection\n- Remove worst-frame column from the bad-tracks list.\n- Properly deselect unrelated tracks when switching between duplicate track\n  pairs in the UI\n- Add a `tox.ini` with `mypy`, `pylint` and `black` code formatting. Black\n  formats locally and verifies in CI.\n- Add a `tox` Github action for PRs and pushes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalles%2Ffind_bad_motion_tracks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwalles%2Ffind_bad_motion_tracks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwalles%2Ffind_bad_motion_tracks/lists"}