RVMN directional edge detection filters and comparison utilities.
Project description
rvmn
RVMN is a small Python package for directional edge detection using custom RVMN-style masks, plus Sobel/Prewitt comparison helpers.
Install
pip install rvmn
For local development from this folder:
pip install -e ".[dev,plots]"
Python Usage
import cv2
import rvmn
image = cv2.imread("image.png")
gray = rvmn.to_grayscale(image)
result = rvmn.apply_rvmn(gray, lam=0.1, rho=0.9, theta=0.3)
sobel = rvmn.apply_sobel(gray)
prewitt = rvmn.apply_prewitt(gray)
metrics = rvmn.compute_metrics(gray, result)
print(metrics.psnr, metrics.rmse)
Search for the best parameter combination:
search = rvmn.search_best_params(gray)
print(search.params)
print(search.metrics.psnr)
cv2.imwrite("rvmn_output.png", search.image)
Compare RVMN, Sobel, and Prewitt in one call:
comparison = rvmn.compare_edges(gray)
print(comparison.rvmn.params)
print(comparison.sobel_metrics.psnr)
print(comparison.prewitt_metrics.psnr)
Command Line
rvmn image.png --output results
This writes rvmn_output.png, sobel_output.png, and prewitt_output.png.
Use fixed RVMN parameters instead of a full search:
rvmn image.png --lambda 0.1 --rho 0.9 --theta 0.3 --output results
Print machine-readable metrics:
rvmn image.png --json
Build
python -m build
The build configuration includes only src/, tests/, README.md, and
pyproject.toml in the source archive, and only the rvmn package in the wheel.
Generated notebooks, images, PDFs, result folders, caches, and old dist/
contents are excluded.
Notes
The coefficient formulas are packaged from the current notebook implementation. Keep citation and formula details close to your paper/report when publishing.
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 Distribution
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 rvmn-0.1.0.tar.gz.
File metadata
- Download URL: rvmn-0.1.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4d79b39fb27df9f5e988d7ceb7cb7d4e24e9e620eaa2725b9de744a3718e47d
|
|
| MD5 |
39b43c9fd7212c5dca922e0d582e81c1
|
|
| BLAKE2b-256 |
47318152f898bd11ee5605b6cd490e4afbad470418925dcb7222ceddb7fb7241
|
File details
Details for the file rvmn-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rvmn-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aea49b60ea13ea070398e990855b33b10563c14b09d7568a5412b11ea10c7a90
|
|
| MD5 |
de61b1c08ec8a10e8e48352ab2b9d12e
|
|
| BLAKE2b-256 |
1d83d41a86cabe989421791967af82f6b6958e3378adb6f7d094d8dc238b5aff
|