{"id":20995595,"url":"https://github.com/tesar-tech/treman_algorithms","last_synced_at":"2025-03-13T13:11:25.347Z","repository":{"id":112971746,"uuid":"191381897","full_name":"tesar-tech/treman_algorithms","owner":"tesar-tech","description":"Algorithms for TremAn app","archived":false,"fork":false,"pushed_at":"2020-08-26T06:37:57.000Z","size":223,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-20T08:50:06.916Z","etag":null,"topics":["image-processing","matlab"],"latest_commit_sha":null,"homepage":null,"language":"MATLAB","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/tesar-tech.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":"2019-06-11T13:53:11.000Z","updated_at":"2020-08-26T06:38:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"cbd30e6f-7a37-43bb-955e-10007e5c1046","html_url":"https://github.com/tesar-tech/treman_algorithms","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tesar-tech%2Ftreman_algorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tesar-tech%2Ftreman_algorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tesar-tech%2Ftreman_algorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tesar-tech%2Ftreman_algorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tesar-tech","download_url":"https://codeload.github.com/tesar-tech/treman_algorithms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243410445,"owners_count":20286395,"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","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":["image-processing","matlab"],"created_at":"2024-11-19T07:24:48.508Z","updated_at":"2025-03-13T13:11:25.319Z","avatar_url":"https://github.com/tesar-tech.png","language":"MATLAB","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TremAn Algorithms\n\nAlgorithms for TremAn app\n\n## Center of motion algorithm\n\n1. Convert frames to gray\n2. Compute difference between frames\n3. Normalize differences frames (df) from 0 to 1 (here using [mat2gray](https://www.mathworks.com/help/images/ref/mat2gray.html) function)\n4. Compute center of motion (something like center of mass, but with normalized df) for X and Y coordinates.\n\n   `centerOfMotionX = mean(A(:) .* X(:)) / meanA;`\n   \n   where `X` are x coordinates of all pixels in `A` (df).\n5. Store this centerOfMotion for every frame.\n6. Compute amplitude spectrum using fft for x and y.\n7. Get max frequency from average (x and y) spectrum.\n\n### Results for testset radim01\n\n- sizeReductionFactor = 0.1 (algorithm works with 1/10 of original resolution)\n- works same with sizeReductionFactor = 0.01 \n\nvideo | real freq [Hz] (counting swings) | freq from acc [Hz]|result freq [Hz] (algorithm)\n---------|----------|---------|-------\nMV1.mp4 | 12 sw/5 s = 2.4     | 0* | 2.36  \nMV2.mp4 | 40 sw/14 s = 2.86   | 2.86 | 2.87  \nMV3.mp4 | 70 sw/17 s = 4.12   | 4.06 | 4.07  \nMV4.mp4 | 90 sw/16 s = 5.625  | 5.48 | 5.63  \nMV5.mp4 | 93 sw/16.5 s = 5.64 | 5.56 | 5.57  \nMV6.mp4 | 45 sw/17.3 s = 2.54 | 2.52 | 2.61  \n\n*data are too short and signal is too low, probably does not fit the video.\n\n#### results for COM algorithm\n\n![mv1](media/img_result_centerofmotion_MV1.mp4.png)\n![mv2](media/img_result_centerofmotion_MV2.mp4.png)\n![mv3](media/img_result_centerofmotion_MV3.mp4.png)\n![mv4](media/img_result_centerofmotion_MV4.mp4.png)\n![mv5](media/img_result_centerofmotion_MV5.mp4.png)\n![mv6](media/img_result_centerofmotion_MV6.mp4.png)\n\n### Current limitations\n\n- Doesn't work for chessboard videos (difference is too sharp )\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftesar-tech%2Ftreman_algorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftesar-tech%2Ftreman_algorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftesar-tech%2Ftreman_algorithms/lists"}