{"id":16113407,"url":"https://github.com/urholaukkarinen/template-matching","last_synced_at":"2025-03-18T09:31:18.413Z","repository":{"id":182376013,"uuid":"668421238","full_name":"urholaukkarinen/template-matching","owner":"urholaukkarinen","description":"GPU-accelerated template matching for Rust","archived":false,"fork":false,"pushed_at":"2023-07-23T13:14:00.000Z","size":67,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-04-29T00:23:21.997Z","etag":null,"topics":["computer-vision","gpu","image-recognition","rust","template-matching"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/urholaukkarinen.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":"2023-07-19T19:08:37.000Z","updated_at":"2024-04-23T21:51:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"fce9f612-71ee-44c2-b076-ee7c3c9dc951","html_url":"https://github.com/urholaukkarinen/template-matching","commit_stats":null,"previous_names":["urholaukkarinen/template-matching"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urholaukkarinen%2Ftemplate-matching","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urholaukkarinen%2Ftemplate-matching/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urholaukkarinen%2Ftemplate-matching/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/urholaukkarinen%2Ftemplate-matching/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/urholaukkarinen","download_url":"https://codeload.github.com/urholaukkarinen/template-matching/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243911251,"owners_count":20367651,"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":["computer-vision","gpu","image-recognition","rust","template-matching"],"created_at":"2024-10-09T20:11:37.754Z","updated_at":"2025-03-18T09:31:18.087Z","avatar_url":"https://github.com/urholaukkarinen.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# template-matching\r\n\r\n[![Latest version](https://img.shields.io/crates/v/template-matching.svg)](https://crates.io/crates/template-matching)\r\n[![Documentation](https://docs.rs/template-matching/badge.svg)](https://docs.rs/template-matching)\r\n![MIT](https://img.shields.io/badge/license-MIT-blue.svg)\r\n\r\nGPU-accelerated template matching library for Rust. The crate is designed as a faster alternative to [imageproc::template_matching](https://docs.rs/imageproc/latest/imageproc/template_matching/index.html).\r\n\r\n## Installation\r\n\r\n```bash\r\n[dependencies]\r\ntemplate-matching = { version = \"0.2.0\", features = [\"image\"] }\r\n```\r\n\r\n## Usage\r\n\r\n```rust\r\nuse template_matching::{find_extremes, match_template, MatchTemplateMethod, TemplateMatcher};\r\n\r\nfn main() {\r\n    // Load images and convert them to f32 grayscale\r\n    let input_image = image::load_from_memory(include_bytes!(\"input.png\")).unwrap().to_luma32f();\r\n    let template_image = image::load_from_memory(include_bytes!(\"template.png\")).unwrap().to_luma32f();\r\n\r\n    let result = match_template(\u0026input_image, \u0026template_image, MatchTemplateMethod::SumOfSquaredDifferences);\r\n\r\n    // Or alternatively you can create the matcher first\r\n    let mut matcher = TemplateMatcher::new();\r\n    matcher.match_template(\u0026input_image, \u0026template_image, MatchTemplateMethod::SumOfSquaredDifferences);\r\n    let result = matcher.wait_for_result().unwrap();\r\n\r\n    // Calculate min \u0026 max values\r\n    let extremes = find_extremes(\u0026result);\r\n}\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furholaukkarinen%2Ftemplate-matching","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Furholaukkarinen%2Ftemplate-matching","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Furholaukkarinen%2Ftemplate-matching/lists"}