Fast traditional image matching backed by C++ and OpenCV
Project description
matchup
matchup is a traditional computer-vision image matcher implemented in C++
with a small Python API. It uses OpenCV SIFT, geometric verification, edge
agreement and appearance checks. It does not use neural-network models.
The current algorithm uses a fixed 64 x 64 working unit, bidirectional SIFT geometry, edge and appearance evidence, and aligned central-content confirmation. See MATCHING_IMPLEMENTATION.md for the current design and MATCHING_FLOWCHART.md for the complete Mermaid flowcharts.
The first release supports 64-bit Windows and CPython 3.10 through 3.14.
Installation
python -m pip install matchup
The Windows wheel contains the native extension and required OpenCV DLLs. Users do not need to install OpenCV, CMake or Visual Studio.
Usage
import matchup
score = matchup.picture_match(image_a, image_b)
Inputs are numeric NumPy arrays in grayscale, RGB or RGBA layout. The returned
score is a symmetric float in the inclusive range [0.0, 1.0].
When spatial sizes differ, the image with the larger short edge is resized to the other image's exact width and height with bicubic interpolation. The C++ matching core always receives equal-size arrays.
For repeated matching, prepare an image once:
reference = matchup.PreparedImage(image_a)
score_hot_cold = reference.match(image_b)
other = matchup.PreparedImage(image_b)
score_hot_hot = reference.match(other)
Equal-size prepared images reuse all preprocessing. A cross-size prepared match intentionally falls back to a cold resize and does not create cached pair-specific variants.
Internally, images whose short edge is above 64 are reduced proportionally to a 64-pixel short edge. Smaller images are not enlarged. Long images are split into corresponding 64 x 64 windows and their evidence is aggregated without allowing one accidental high tile to dominate the result.
The fixed working-unit API is also available:
score = matchup.picture_match_64(image_64_a, image_64_b)
resized = matchup.resize_image(image, target_height=80, target_width=80)
Development
Prerequisites:
- Windows x64
- Visual Studio 2022 with the C++ desktop toolchain
- Python 3.10 or newer
- uv
Create the environment and build a wheel:
uv sync --no-install-project --group dev
uv build --wheel
CMake downloads the pinned OpenCV 4.12.0 source archive. To reuse an existing OpenCV source tree during local development:
$env:CMAKE_ARGS = "-DMATCHUP_OPENCV_SOURCE_DIR=C:\path\to\opencv\sources"
uv build --wheel
Install and test the wheel in a clean environment:
uv venv .wheel-test
uv pip install --python .wheel-test\Scripts\python.exe dist\matchup-*.whl
.wheel-test\Scripts\python.exe -m pytest tests
OpenCV is configured without an internal parallel framework, and the native module verifies single-thread mode when imported.
License
matchup is licensed under the MIT License. See NOTICE for third-party
components and their licenses.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file matchup-1.0.8.tar.gz.
File metadata
- Download URL: matchup-1.0.8.tar.gz
- Upload date:
- Size: 95.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c50567134d049122cc62e89186af2b6e938ab652febb9892d6e61a4dcc6aaf0f
|
|
| MD5 |
e284bf76b6521cb73e1281ca2a5f0daa
|
|
| BLAKE2b-256 |
083e7bc50b1baaabcddc44ea568861923297815ad04d3e1ca38b6dc410763585
|
Provenance
The following attestation bundles were made for matchup-1.0.8.tar.gz:
Publisher:
release.yml on hurd-git/matchup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
matchup-1.0.8.tar.gz -
Subject digest:
c50567134d049122cc62e89186af2b6e938ab652febb9892d6e61a4dcc6aaf0f - Sigstore transparency entry: 2194898897
- Sigstore integration time:
-
Permalink:
hurd-git/matchup@8cf56fdbae02cca6c56bd608d3e48d4a05ae0cfc -
Branch / Tag:
refs/tags/v1.0.8 - Owner: https://github.com/hurd-git
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8cf56fdbae02cca6c56bd608d3e48d4a05ae0cfc -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file matchup-1.0.8-cp314-cp314-win_amd64.whl.
File metadata
- Download URL: matchup-1.0.8-cp314-cp314-win_amd64.whl
- Upload date:
- Size: 6.3 MB
- Tags: CPython 3.14, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a14046794779cb29fd5ea2dadc602107b5d36a2bf08418854fdc95334beec090
|
|
| MD5 |
dc1aa2456cc425d23ac30a0b4dbe59a9
|
|
| BLAKE2b-256 |
c17c73b48ab650e44ac6d3958dd101b265b200120a1e47c03df3db11f4be4d4b
|
Provenance
The following attestation bundles were made for matchup-1.0.8-cp314-cp314-win_amd64.whl:
Publisher:
release.yml on hurd-git/matchup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
matchup-1.0.8-cp314-cp314-win_amd64.whl -
Subject digest:
a14046794779cb29fd5ea2dadc602107b5d36a2bf08418854fdc95334beec090 - Sigstore transparency entry: 2194898904
- Sigstore integration time:
-
Permalink:
hurd-git/matchup@8cf56fdbae02cca6c56bd608d3e48d4a05ae0cfc -
Branch / Tag:
refs/tags/v1.0.8 - Owner: https://github.com/hurd-git
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8cf56fdbae02cca6c56bd608d3e48d4a05ae0cfc -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file matchup-1.0.8-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: matchup-1.0.8-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 6.1 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58b83bb5c69521ff6e19d7dd08608f9370d3f8391f113d2b0ca95d9edfdbf8dd
|
|
| MD5 |
21f2d46bf12a03f1894e501ee50885f1
|
|
| BLAKE2b-256 |
7e4e8ca26199cb29089f2df408d14c64a58a05c34fa38e0ab82c5b98a8f405b6
|
Provenance
The following attestation bundles were made for matchup-1.0.8-cp313-cp313-win_amd64.whl:
Publisher:
release.yml on hurd-git/matchup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
matchup-1.0.8-cp313-cp313-win_amd64.whl -
Subject digest:
58b83bb5c69521ff6e19d7dd08608f9370d3f8391f113d2b0ca95d9edfdbf8dd - Sigstore transparency entry: 2194898907
- Sigstore integration time:
-
Permalink:
hurd-git/matchup@8cf56fdbae02cca6c56bd608d3e48d4a05ae0cfc -
Branch / Tag:
refs/tags/v1.0.8 - Owner: https://github.com/hurd-git
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8cf56fdbae02cca6c56bd608d3e48d4a05ae0cfc -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file matchup-1.0.8-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: matchup-1.0.8-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 6.1 MB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d26ec48cb0125335ecc213ca6f470394c6ed889254c14a9a9b81863c801b1f12
|
|
| MD5 |
6e40c10f8ee5ca2936c2e7bdb75db2fb
|
|
| BLAKE2b-256 |
65153404935a09ece16baf54c3b56b8f0a6397a4f5324fbe9285427c6a065a2d
|
Provenance
The following attestation bundles were made for matchup-1.0.8-cp312-cp312-win_amd64.whl:
Publisher:
release.yml on hurd-git/matchup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
matchup-1.0.8-cp312-cp312-win_amd64.whl -
Subject digest:
d26ec48cb0125335ecc213ca6f470394c6ed889254c14a9a9b81863c801b1f12 - Sigstore transparency entry: 2194898900
- Sigstore integration time:
-
Permalink:
hurd-git/matchup@8cf56fdbae02cca6c56bd608d3e48d4a05ae0cfc -
Branch / Tag:
refs/tags/v1.0.8 - Owner: https://github.com/hurd-git
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8cf56fdbae02cca6c56bd608d3e48d4a05ae0cfc -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file matchup-1.0.8-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: matchup-1.0.8-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 6.1 MB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
646d00366028dcf45961109db1fd0822ce492bf991b0fd60b4fdd9bfd676d72b
|
|
| MD5 |
e9922e89a3163d7db42393024fd81b6e
|
|
| BLAKE2b-256 |
f06ecc1e3109003b3d1681f78d2e4b35bd29ff11984f85a499cd08389eed24c4
|
Provenance
The following attestation bundles were made for matchup-1.0.8-cp311-cp311-win_amd64.whl:
Publisher:
release.yml on hurd-git/matchup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
matchup-1.0.8-cp311-cp311-win_amd64.whl -
Subject digest:
646d00366028dcf45961109db1fd0822ce492bf991b0fd60b4fdd9bfd676d72b - Sigstore transparency entry: 2194898910
- Sigstore integration time:
-
Permalink:
hurd-git/matchup@8cf56fdbae02cca6c56bd608d3e48d4a05ae0cfc -
Branch / Tag:
refs/tags/v1.0.8 - Owner: https://github.com/hurd-git
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8cf56fdbae02cca6c56bd608d3e48d4a05ae0cfc -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file matchup-1.0.8-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: matchup-1.0.8-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 6.1 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac9f999fe7b2176ad3edb2b66e0a51c72e97630dcbd5913f4aadd56b45797ebe
|
|
| MD5 |
472b0f84b332e98690e9b19203a29b3f
|
|
| BLAKE2b-256 |
fc5400dcd08d6e21c79613f6225f8154c550da95a3452eb22413ec6fd8bf2715
|
Provenance
The following attestation bundles were made for matchup-1.0.8-cp310-cp310-win_amd64.whl:
Publisher:
release.yml on hurd-git/matchup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
matchup-1.0.8-cp310-cp310-win_amd64.whl -
Subject digest:
ac9f999fe7b2176ad3edb2b66e0a51c72e97630dcbd5913f4aadd56b45797ebe - Sigstore transparency entry: 2194898914
- Sigstore integration time:
-
Permalink:
hurd-git/matchup@8cf56fdbae02cca6c56bd608d3e48d4a05ae0cfc -
Branch / Tag:
refs/tags/v1.0.8 - Owner: https://github.com/hurd-git
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8cf56fdbae02cca6c56bd608d3e48d4a05ae0cfc -
Trigger Event:
workflow_dispatch
-
Statement type: