Phase based feature detection and image enhancement
Project description
phasecongruency
Python package for phase-congruency-based feature detection and phase-preserving image enhancement.
Installation
From source with pip:
pip install .
Editable install for development:
pip install -e ".[dev]"
Or with uv:
uv sync --extra dev
Quick Start
from phasecongruency import phasecongmono, phasecong3, phasesym, step2line
img = step2line(256)
# Fast monogenic phase congruency (defaults)
PC, orientation, phase_type, T = phasecongmono(img)
# Tuned monogenic phase congruency (all key parameters configurable)
PC2, orientation2, phase_type2, T2 = phasecongmono(
img,
nscale=5,
minwavelength=3,
mult=2.1,
sigmaonf=0.55,
k=3.0,
noisemethod=-1,
cutoff=0.5,
g=10.0,
deviationgain=1.5,
)
# Oriented phase congruency (edge/corner moments)
M, m, or_, feat_type, EO, T3 = phasecong3(
img,
nscale=4,
norient=6,
minwavelength=3,
mult=2.1,
sigmaonf=0.55,
k=2.0,
cutoff=0.5,
g=10.0,
noisemethod=-1,
)
# Phase symmetry (blob/line-like structures)
phSym, orient, totalEnergy, Tps = phasesym(img)
Parameter Configurability
Core algorithm parameters are exposed as keyword arguments in Python.
- Use keyword arguments on:
phasecongmono,phasecong3,phasesymmono,phasesym,ppdrc,ppdenoise,monofilt,gaborconvolve,highpassmonogenic, andbandpassmonogenic. - Default values are defined in each function signature.
- Inspect any callable signature directly:
from inspect import signature
from phasecongruency import phasecongmono
print(signature(phasecongmono))
Run Tests
UV_CACHE_DIR=.uv-cache uv run pytest tests -q
# or
pytest tests -q
Scope
This repository now maintains the Python implementation only. The historical Julia transpilation/validation workflow has been retired from the active tree.
Validation Provenance
A Julia-vs-Python fidelity validation was completed before this cleanup. See:
docs/validation.md
Attribution
This work is based on Peter Kovesi's phase congruency methods and was originally transpiled from:
Project details
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 phasecongruency-1.0.3.tar.gz.
File metadata
- Download URL: phasecongruency-1.0.3.tar.gz
- Upload date:
- Size: 50.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56472dce9f0d9e8b34dffb7b98228ec2891c3859ef3cf0cefe0ee77ebbcc8336
|
|
| MD5 |
fb9f23c744fbd48d5414556cf43a8ffc
|
|
| BLAKE2b-256 |
6b0828252104c3ff92510c2abf2d86ad495fc66c793edc8ea97ad03b4451ed14
|
Provenance
The following attestation bundles were made for phasecongruency-1.0.3.tar.gz:
Publisher:
publish-pypi.yml on sigjhl/ImagePhaseCongruency.py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
phasecongruency-1.0.3.tar.gz -
Subject digest:
56472dce9f0d9e8b34dffb7b98228ec2891c3859ef3cf0cefe0ee77ebbcc8336 - Sigstore transparency entry: 975829198
- Sigstore integration time:
-
Permalink:
sigjhl/ImagePhaseCongruency.py@88d59db9258661cd4d8bad2c436c6f240b70ac1e -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/sigjhl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@88d59db9258661cd4d8bad2c436c6f240b70ac1e -
Trigger Event:
push
-
Statement type:
File details
Details for the file phasecongruency-1.0.3-py3-none-any.whl.
File metadata
- Download URL: phasecongruency-1.0.3-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f905a00b301647e4baf510f86fed5bd917dcbb30648560fb2c0e2b114055dee3
|
|
| MD5 |
9e475a6f6ac4d7b26f33c92c7ea88c6e
|
|
| BLAKE2b-256 |
6ff731def1e78d1d1581758ad26244e0b3905c0f0ffd9ee30d71930be30c6523
|
Provenance
The following attestation bundles were made for phasecongruency-1.0.3-py3-none-any.whl:
Publisher:
publish-pypi.yml on sigjhl/ImagePhaseCongruency.py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
phasecongruency-1.0.3-py3-none-any.whl -
Subject digest:
f905a00b301647e4baf510f86fed5bd917dcbb30648560fb2c0e2b114055dee3 - Sigstore transparency entry: 975829200
- Sigstore integration time:
-
Permalink:
sigjhl/ImagePhaseCongruency.py@88d59db9258661cd4d8bad2c436c6f240b70ac1e -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/sigjhl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@88d59db9258661cd4d8bad2c436c6f240b70ac1e -
Trigger Event:
push
-
Statement type: