Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/preco21/opencv-match
A Rust library that simplifies template matching with OpenCV
https://github.com/preco21/opencv-match
computer-vision image-processing opencv rust template-match template-matching
Last synced: 17 days ago
JSON representation
A Rust library that simplifies template matching with OpenCV
- Host: GitHub
- URL: https://github.com/preco21/opencv-match
- Owner: preco21
- License: mit
- Created: 2024-08-31T07:15:49.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-09-29T18:32:24.000Z (about 2 months ago)
- Last Synced: 2024-10-10T17:42:18.829Z (about 1 month ago)
- Topics: computer-vision, image-processing, opencv, rust, template-match, template-matching
- Language: Rust
- Homepage:
- Size: 263 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# opencv-match
> A Rust library that simplifies template matching with OpenCV
## Prerequisites
This library is built on top of the [OpenCV](https://opencv.org/) library. You will need to have OpenCV installed on your system.
You can find the instructions [here](https://github.com/twistedfall/opencv-rust/blob/master/INSTALL.md).
Currently supports `v0.92.2` of the `opencv` crate.
[TODO: Make version selection more flexible]
## Install
```shell
cargo add opencv-match# Alternatively, pull from the repository directly:
cargo add --git https://github.com/preco21/opencv-match.git
```## Features
- **Multiple template matching:** Detects and matches multiple instances of a template within a single image.
- **Non-maximum suppression:** Integrates [non-maximum suppression](https://builtin.com/machine-learning/non-maximum-suppression) to eliminate duplicate matches.
- **Directional clustering:** Clusters matching points vertically or horizontally into distinct sections, organizing them into bounding boxes for segmentation.[TODO: Scale-invariant matching, Angle-invariant matching]
## Usage
[WIP]
## FAQ
### How can I link OpenCV statically in Windows?
Assuming you are using [`vcpkg`](https://vcpkg.io/), you install the static version of OpenCV with the following commands:
```powershell
vcpkg add zlib:x64-windows-static opencv4[contrib,nonfree]:x64-windows-static
vcpkg install zlib:x64-windows-static opencv4[contrib,nonfree]:x64-windows-static
```This will take a while to build. After that, you can link the static libraries in your `Cargo.toml`:
```toml
[env]
OPENCV_LINK_LIBS = "zlib,opencv_core4,opencv_imgproc4"
OPENCV_INCLUDE_PATHS = "C:\\[PATH_TO_VCPKG]\\installed\\x64-windows-static\\include"
OPENCV_LINK_PATHS = "C:\\[PATH_TO_VCPKG]\\installed\\x64-windows-static\\lib"
OPENCV_MSVC_CRT = "static"[target.x86_64-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
```[WIP: Do we need OPENCV_LINK_LIBS explicitly specified?]