{"id":16513590,"url":"https://github.com/levysantiago/image-matching-algorithm","last_synced_at":"2026-06-09T19:31:23.941Z","repository":{"id":131074840,"uuid":"320101742","full_name":"levysantiago/image-matching-algorithm","owner":"levysantiago","description":"Nova implementação do problema NP-Completo Image Matching com Python.","archived":false,"fork":false,"pushed_at":"2020-12-15T00:03:42.000Z","size":892,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T10:24:00.714Z","etag":null,"topics":["algoritmo","image-matching","imagens","pillow","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/levysantiago.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-12-09T23:05:41.000Z","updated_at":"2020-12-15T00:03:45.000Z","dependencies_parsed_at":"2023-04-24T05:08:10.945Z","dependency_job_id":null,"html_url":"https://github.com/levysantiago/image-matching-algorithm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/levysantiago/image-matching-algorithm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levysantiago%2Fimage-matching-algorithm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levysantiago%2Fimage-matching-algorithm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levysantiago%2Fimage-matching-algorithm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levysantiago%2Fimage-matching-algorithm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/levysantiago","download_url":"https://codeload.github.com/levysantiago/image-matching-algorithm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/levysantiago%2Fimage-matching-algorithm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34123171,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"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":["algoritmo","image-matching","imagens","pillow","python","python3"],"created_at":"2024-10-11T16:09:26.165Z","updated_at":"2026-06-09T19:31:23.918Z","avatar_url":"https://github.com/levysantiago.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Implementação do problema _Image Matching_\n\nEste repositório foi criado com o intuito de realizar uma nova implementação para resolver o problema do _Image Matching_, um problema NP-Completo. Abaixo é apresentado um breve resumo do que é o problema em si, para informações mais aprofundadas, verificar o [docs/RelatorioParcial.pdf](https://github.com/Levysantiago/image-matching-algorithm/tree/master/docs/RelatorioParcial.pdf) e [docs/RelatorioFinal.pdf](https://github.com/Levysantiago/image-matching-algorithm/tree/master/docs/RelatorioFinal.pdf).\n\n## Sumário\n\n- [Image Matching (IM)](#image-matching-im)\n- [Getting Started](#getting-started)\n  - [Versões](#versões)\n  - [Organização](#organização)\n  - [Dependências](#dependências)\n    - [SIFT](#sift)\n  - [Executando os algoritmos](#executando-os-algoritmos)\n  - [Incluindo suas próprias imagens](#incluindo-suas-próprias-imagens)\n- [Autores](#autores)\n- [Conhecimentos](#conhecimentos)\n  - [Livros](#livros)\n  - [Artigos](#artigos)\n\n## Image Matching (IM)\n\nO problema do IM ou Correspondência de Imagem tem sido abordado por diversos autores, a fim de buscar melhores técnicas para uma solução mais rápida e precisa. O problema consiste em analisar duas imagens A e B, onde B é uma transformação geométrica de A. O resultado desta análise deve ser o encontro de características semelhantes entre elas, de forma que, no final, estas correspondências sejam realçadas e apresentadas para facilitar uma determinada investigação. O IM é um componente chave para diversos processos de análise de imagens e é muito importante para inúmeras aplicações, como navegação, orientação, vigilância automática, fotogrametria e visão robótica. Na medicina, por exemplo, é de grande importância para encontrar relações entre diferenças no posicionamento do paciente, modalidades e aquisição de imagens variadas.\n\n## Getting Started\n\n### Versões\n\n- Python 3.6.12 (esta foi a versão utilizada, mas funciona para outras versões também)\n\n### Organização\n\nOs principais arquivos encontram-se na pasta _root_. O `main.py` abre as imagens para dar como entrada ao algoritmo `lr2Matching.py`, que irá tentar encontrar correspondências entre as imagens. `helpers.py` contém diversas funções implementadas para serem utilizadas pelo algoritmo, o algoritmo SIFT está implementado no arquivo `SIFT.py` e o `plotGraph.py` é uma biblioteca usada para plotar o gráfico de comparação dos tempos em que cada algoritmo tomaram para resolver o problema. Na pasta `assets`, são organizadas todas as imagens que podem ser utilizadas como entrada do algoritmo. A pasta `docs` contém os relatórios com uma explicação melhor do problema em si e da proposta deste trabalho. A pasta `graph` contém o gráfico comparativo gerado pelo algoritmo depois de rodar a `main.py`. A pasta `tests` irá conter todos os resultados das correlações em imagens gerados pelos algoritmos para cada caso de teste.\n\n```text\nassets/\n    apple.jpg\n    apple2.jpg\n    ...\ndocs/\n    RelatorioParcial.pdf\n    RelatorioFinal.pdf\ngraph/\n    comparison.png\ntests/\n    .gitkeep\n    ...\nmain.py\nlrMatching.py\nSIFT.py\nplotGraph.py\nhelpers.py\n```\n\n### Dependências\n\nSe você não tiver a biblioteca **Pillow** instalada, para instalar você pode utilizar os seguintes comandos:\n\n```bash\n$ pip install Pillow --user\n```\n\n`Caso seu python3 não seja o padrão, pode ser que você precise usar pip3 ou pip3.6`\n\n```bash\n$ pip3 install Pillow --user\n```\n\nMais informações aqui na [documentação da biblioteca](https://pillow.readthedocs.io/en/3.0.x/installation.html).\n\n#### SIFT\n\nPara rodar o SIFT foi necessário utilizar algumas exatas versões de alguns pacotes.\n\n```bash\n$ pip3.6 install opencv-python==3.4.2.16\n```\n\n```bash\n$ pip3.6 install opencv-contrib-python==3.4.2.16\n```\n\n```bash\n$ sudo apt-get install python3.6-tk\n```\n\n```bash\n$ pip3.6 install matplotlib\n```\n\nO código do algoritmo SIFT foi obtido através do site: https://www.analyticsvidhya.com/blog/2019/10/detailed-guide-powerful-sift-technique-image-matching-python/, aqui o funcionamento do algoritmo é explicado brevemente.\n\n### Executando os algoritmos\n\nO arquivo principal é o `main.py` que, por sua vez, irá chamar o algoritmo `lr2Matching.py`. Para iniciar o primeiro teste, basta rodar o comando:\n\n```bash\n$ python main.py\n```\n\nou\n\n```bash\n$ python3.6 main.py\n```\n\nAo rodar o algoritmo, ele irá rodar as três implementações e gerar os resultados das correlações em imagens na pasta `tests`, também irá gerar um gráfico comparativo na pasta `graph/` em relação ao tempo de execução que cada algoritmo levou para resolver o problema.\n\n### Incluindo suas próprias imagens\n\nPara utilizar os algoritmos com outras imagens de teste, primeiramente você deve incluir as imagens na pasta `assets`. Depois é só abrir o arquivo `main.py` e incluir os nomes das imagens nas seguintes linhas:\n\n```python\n[...]\nsrcImages = [\n    ('mundi.jpg', 'mundi2.jpg'),\n    ('cube.jpg', 'cube2.jpg'),\n    ('many.jpg', 'many2.jpg'),\n    ('apple.jpg', 'apple2.jpg'),\n    ('appleCima.jpg', 'appleCima2.jpg'),\n    ('novaImagem.jpg', 'novaImagem2.jpg'), #Novas imagens incluídas\n    ]\n[...]\n```\n\nLembrando que as imagens precisam ser de mesmo tamanho e que devem ser quadradas para que todos os algoritmos rodem bem. Também a segunda imagem deve ser uma transformação geométrica da primeira, isto é, o mesmo objeto em um ângulo diferente ou deslocado na imagem. Depois só rodar o algoritmo com `python3.6 main.py`.\n\n## Autores\n\n- [Levy Santiago](https://github.com/Levysantiago)\n- [Marcos Pinheiro](https://github.com/Mrpsousa)\n- [Rita Barreto](https://github.com/RCNB)\n\n## Conhecimentos\n\n### Livros\n\n- [Introduction to algorithms](https://books.google.com.br/books?hl=pt-BR\u0026lr=\u0026id=aefUBQAAQBAJ\u0026oi=fnd\u0026pg=PR5\u0026dq=Introduction+to+algorithms\u0026ots=dO2uTvYOeX\u0026sig=YMyUQYOoXToTjjPUV99TIT58ohg#v=onepage\u0026q=Introduction%20to%20algorithms\u0026f=false)\n- [Programming Computer Vision with Python: Tools and algorithms for analyzing images](https://books.google.com.br/books?hl=pt-BR\u0026lr=\u0026id=J9b_CH-NrycC\u0026oi=fnd\u0026pg=PP2\u0026dq=Programming+Computer+Vision+with+Python:+Tools+and+algorithms+for+analyzing+images\u0026ots=B-38UYbJqx\u0026sig=WoLkUH6S22_Mm5S71cwjrsYTiDA#v=onepage\u0026q=Programming%20Computer%20Vision%20with%20Python%3A%20Tools%20and%20algorithms%20for%20analyzing%20images\u0026f=false)\n- [Computer Vision with Python 3](https://books.google.com.br/books?hl=pt-BR\u0026lr=\u0026id=jpZGDwAAQBAJ\u0026oi=fnd\u0026pg=PP1\u0026dq=Computer+Vision+with+python+3\u0026ots=XMF3c6fGwh\u0026sig=6H9AgtnYb7AneoYpzUJXukhJ9ns#v=onepage\u0026q=Computer%20Vision%20with%20python%203\u0026f=false)\n- [Hands-On Image Processing with Python: Expert techniques for advanced image analysis and effective interpretation of image data](https://books.google.com.br/books?hl=pt-BR\u0026lr=\u0026id=gC59DwAAQBAJ\u0026oi=fnd\u0026pg=PP1\u0026dq=Hands-On+Image+Processing+with+Python:+Expert+techniques+for+advanced+image+analysis+and+effective+interpretation+of+image+data\u0026ots=AhZIih7R8C\u0026sig=I5_pCu0rqBWm64t08qzMK2E8A10#v=onepage\u0026q=Hands-On%20Image%20Processing%20with%20Python%3A%20Expert%20techniques%20for%20advanced%20image%20analysis%20and%20effective%20interpretation%20of%20image%20data\u0026f=false)\n\n### Artigos\n\n- [Elastic image matching is NP-complete](https://www.sciencedirect.com/science/article/pii/S0167865502002684?casa_token=cCHDdprnZs0AAAAA:DXQhG5ygMFkNKBskKszKVCHyDZRDsQvq2va4WL1miM_EAcfNe_ECoXgUtaJTpT2PFlms5xA0HA)\n- [A monotonic and continuous two-dimensional warping based on dynamic programming](https://ieeexplore.ieee.org/abstract/document/711195/?casa_token=LZq0AKFvXDoAAAAA:o5MgPyJFAbS2Z1fh-wd_JWls2h7RW1z07uKE4tNQVF0dd5xN7-mCeF1V5yW4PWYmIoyMq3pU3A)\n- [Desenvolvimento de Algoritmos de Exploração e Mapeamento Visual para Robôs Móveis de Baixo Custo](https://www.maxwell.vrac.puc-rio.br/9142/9142_1.PDF)\n- [Distinctive image features from scale-invariant keypoints](https://link.springer.com/article/10.1023/B:VISI.0000029664.99615.94)\n- [Structural indexing of infra-red images using statistical histogram comparison](https://www.sciencedirect.com/science/article/pii/B9780444825872501439)\n- [Digital image processing](https://www.pearson.com/us/higher-education/program/Gonzalez-Digital-Image-Processing-4th-Edition/PGM241219.html)\n- [A novel approach to detecting duplicate images using multiple hash tables](https://link.springer.com/article/10.1007/s11042-014-1857-x)\n- [Variational methods for multimodal image matching](https://link.springer.com/article/10.1023/A:1020830525823)\n- [Adaptive least squares correlation: a powerful image matching technique](https://www.researchgate.net/profile/Armin_Gruen/publication/265292615_Adaptive_Least_Squares_Correlation_A_powerful_image_matching_technique/links/0deec52a08d9325463000000/Adaptive-Least-Squares-Correlation-A-powerful-image-matching-technique.pdf)\n- [Medical image matching-a review with classification](https://ieeexplore.ieee.org/abstract/document/195938?casa_token=Z5wACQ0M-VUAAAAA:_1ZAYQF_WldvQ86uJAmL1lPLSkK4GZcUCmHSJM0xnyUea6uxybOaCOnZwqIPdl80up0fZsQHlg)\n- [A nonlinear variational problem for image matching](https://epubs.siam.org/doi/abs/10.1137/0915014)\n- [Variational problems on flows of diffeomorphisms for image matching](https://www.jstor.org/stable/43638248?casa_token=9ZTr5avo57EAAAAA%3A5RszoIxY-zHc_fV6UH9rxNsO5xr8kDO3_896qCiO2tveKlrDWKFbnt3KMoafas9mJsyi4gzeQ7CKBVMxXWOrdTzuu9mOkm3AsiUOJfnXiHgnIlj-Z_k\u0026seq=1#metadata_info_tab_contents)\n- [Image matching from handcrafted to deep features: A survey](https://link.springer.com/article/10.1007/s11263-020-01359-2)\n- [Modification of blurred image matching method](http://www.mathnet.ru/php/archive.phtml?wshow=paper\u0026jrnid=co\u0026paperid=807\u0026option_lang=eng)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevysantiago%2Fimage-matching-algorithm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flevysantiago%2Fimage-matching-algorithm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevysantiago%2Fimage-matching-algorithm/lists"}