phasecongruency 0.2.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Peter Kovesi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,4 @@
1
+ include README.md
2
+ include LICENSE
3
+ include logo.png
4
+ recursive-include phasecongruency *.py
@@ -0,0 +1,132 @@
1
+ Metadata-Version: 2.4
2
+ Name: phasecongruency
3
+ Version: 0.2.3
4
+ Summary: Phase based feature detection and image enhancement
5
+ Author: Peter Kovesi
6
+ Maintainer: sigjhl
7
+ License-Expression: MIT
8
+ Project-URL: Homepage, https://github.com/sigjhl/ImagePhaseCongruency.py
9
+ Project-URL: Repository, https://github.com/sigjhl/ImagePhaseCongruency.py
10
+ Project-URL: Issues, https://github.com/sigjhl/ImagePhaseCongruency.py/issues
11
+ Keywords: image-processing,phase-congruency,feature-detection,computer-vision
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
21
+ Requires-Python: >=3.9
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ Requires-Dist: numpy>=1.20
25
+ Requires-Dist: scipy>=1.7
26
+ Provides-Extra: dev
27
+ Requires-Dist: pytest>=7.0; extra == "dev"
28
+ Dynamic: license-file
29
+
30
+ # phasecongruency
31
+
32
+ Python package for phase-congruency-based feature detection and phase-preserving image enhancement.
33
+
34
+ ## Installation
35
+
36
+ From source with pip:
37
+
38
+ ```bash
39
+ pip install .
40
+ ```
41
+
42
+ Editable install for development:
43
+
44
+ ```bash
45
+ pip install -e ".[dev]"
46
+ ```
47
+
48
+ Or with uv:
49
+
50
+ ```bash
51
+ uv sync --extra dev
52
+ ```
53
+
54
+ ## Quick Start
55
+
56
+ ```python
57
+ from phasecongruency import phasecongmono, phasecong3, phasesym, step2line
58
+
59
+ img = step2line(256)
60
+
61
+ # Fast monogenic phase congruency (defaults)
62
+ PC, orientation, phase_type, T = phasecongmono(img)
63
+
64
+ # Tuned monogenic phase congruency (all key parameters configurable)
65
+ PC2, orientation2, phase_type2, T2 = phasecongmono(
66
+ img,
67
+ nscale=5,
68
+ minwavelength=3,
69
+ mult=2.1,
70
+ sigmaonf=0.55,
71
+ k=3.0,
72
+ noisemethod=-1,
73
+ cutoff=0.5,
74
+ g=10.0,
75
+ deviationgain=1.5,
76
+ )
77
+
78
+ # Oriented phase congruency (edge/corner moments)
79
+ M, m, or_, feat_type, EO, T3 = phasecong3(
80
+ img,
81
+ nscale=4,
82
+ norient=6,
83
+ minwavelength=3,
84
+ mult=2.1,
85
+ sigmaonf=0.55,
86
+ k=2.0,
87
+ cutoff=0.5,
88
+ g=10.0,
89
+ noisemethod=-1,
90
+ )
91
+
92
+ # Phase symmetry (blob/line-like structures)
93
+ phSym, orient, totalEnergy, Tps = phasesym(img)
94
+ ```
95
+
96
+ ## Parameter Configurability
97
+
98
+ Core algorithm parameters are exposed as keyword arguments in Python.
99
+
100
+ - Use keyword arguments on: `phasecongmono`, `phasecong3`, `phasesymmono`, `phasesym`, `ppdrc`, `ppdenoise`, `monofilt`, `gaborconvolve`, `highpassmonogenic`, and `bandpassmonogenic`.
101
+ - Default values are defined in each function signature.
102
+ - Inspect any callable signature directly:
103
+
104
+ ```python
105
+ from inspect import signature
106
+ from phasecongruency import phasecongmono
107
+ print(signature(phasecongmono))
108
+ ```
109
+
110
+ ## Run Tests
111
+
112
+ ```bash
113
+ UV_CACHE_DIR=.uv-cache uv run pytest tests -q
114
+ # or
115
+ pytest tests -q
116
+ ```
117
+
118
+ ## Scope
119
+
120
+ This repository now maintains the Python implementation only. The historical Julia transpilation/validation workflow has been retired from the active tree.
121
+
122
+ ## Validation Provenance
123
+
124
+ A Julia-vs-Python fidelity validation was completed before this cleanup. See:
125
+
126
+ - `docs/validation.md`
127
+
128
+ ## Attribution
129
+
130
+ This work is based on Peter Kovesi's phase congruency methods and was originally transpiled from:
131
+
132
+ - [ImagePhaseCongruency.jl](https://github.com/peterkovesi/ImagePhaseCongruency.jl)
@@ -0,0 +1,103 @@
1
+ # phasecongruency
2
+
3
+ Python package for phase-congruency-based feature detection and phase-preserving image enhancement.
4
+
5
+ ## Installation
6
+
7
+ From source with pip:
8
+
9
+ ```bash
10
+ pip install .
11
+ ```
12
+
13
+ Editable install for development:
14
+
15
+ ```bash
16
+ pip install -e ".[dev]"
17
+ ```
18
+
19
+ Or with uv:
20
+
21
+ ```bash
22
+ uv sync --extra dev
23
+ ```
24
+
25
+ ## Quick Start
26
+
27
+ ```python
28
+ from phasecongruency import phasecongmono, phasecong3, phasesym, step2line
29
+
30
+ img = step2line(256)
31
+
32
+ # Fast monogenic phase congruency (defaults)
33
+ PC, orientation, phase_type, T = phasecongmono(img)
34
+
35
+ # Tuned monogenic phase congruency (all key parameters configurable)
36
+ PC2, orientation2, phase_type2, T2 = phasecongmono(
37
+ img,
38
+ nscale=5,
39
+ minwavelength=3,
40
+ mult=2.1,
41
+ sigmaonf=0.55,
42
+ k=3.0,
43
+ noisemethod=-1,
44
+ cutoff=0.5,
45
+ g=10.0,
46
+ deviationgain=1.5,
47
+ )
48
+
49
+ # Oriented phase congruency (edge/corner moments)
50
+ M, m, or_, feat_type, EO, T3 = phasecong3(
51
+ img,
52
+ nscale=4,
53
+ norient=6,
54
+ minwavelength=3,
55
+ mult=2.1,
56
+ sigmaonf=0.55,
57
+ k=2.0,
58
+ cutoff=0.5,
59
+ g=10.0,
60
+ noisemethod=-1,
61
+ )
62
+
63
+ # Phase symmetry (blob/line-like structures)
64
+ phSym, orient, totalEnergy, Tps = phasesym(img)
65
+ ```
66
+
67
+ ## Parameter Configurability
68
+
69
+ Core algorithm parameters are exposed as keyword arguments in Python.
70
+
71
+ - Use keyword arguments on: `phasecongmono`, `phasecong3`, `phasesymmono`, `phasesym`, `ppdrc`, `ppdenoise`, `monofilt`, `gaborconvolve`, `highpassmonogenic`, and `bandpassmonogenic`.
72
+ - Default values are defined in each function signature.
73
+ - Inspect any callable signature directly:
74
+
75
+ ```python
76
+ from inspect import signature
77
+ from phasecongruency import phasecongmono
78
+ print(signature(phasecongmono))
79
+ ```
80
+
81
+ ## Run Tests
82
+
83
+ ```bash
84
+ UV_CACHE_DIR=.uv-cache uv run pytest tests -q
85
+ # or
86
+ pytest tests -q
87
+ ```
88
+
89
+ ## Scope
90
+
91
+ This repository now maintains the Python implementation only. The historical Julia transpilation/validation workflow has been retired from the active tree.
92
+
93
+ ## Validation Provenance
94
+
95
+ A Julia-vs-Python fidelity validation was completed before this cleanup. See:
96
+
97
+ - `docs/validation.md`
98
+
99
+ ## Attribution
100
+
101
+ This work is based on Peter Kovesi's phase congruency methods and was originally transpiled from:
102
+
103
+ - [ImagePhaseCongruency.jl](https://github.com/peterkovesi/ImagePhaseCongruency.jl)
Binary file
@@ -0,0 +1,107 @@
1
+ """
2
+ Image Phase Congruency
3
+
4
+ Phase based feature detection and image enhancement.
5
+
6
+ Peter Kovesi
7
+ peterkovesi.com
8
+ """
9
+
10
+ # Phase congruency and feature detection
11
+ from .phasecongruency import (
12
+ phasecongmono,
13
+ phasesymmono,
14
+ ppdrc,
15
+ highpassmonogenic,
16
+ bandpassmonogenic,
17
+ gaborconvolve,
18
+ monofilt,
19
+ phasecong3,
20
+ phasesym,
21
+ ppdenoise,
22
+ )
23
+
24
+ # Frequency domain filters
25
+ from .frequencyfilt import (
26
+ filtergrid,
27
+ filtergrids,
28
+ gridangles,
29
+ cosineangularfilter,
30
+ gaussianangularfilter,
31
+ lowpassfilter,
32
+ highpassfilter,
33
+ bandpassfilter,
34
+ highboostfilter,
35
+ loggabor,
36
+ monogenicfilters,
37
+ packedmonogenicfilters,
38
+ perfft2,
39
+ geoseries,
40
+ )
41
+
42
+ # Synthetic test images
43
+ from .syntheticimages import (
44
+ step2line,
45
+ circsine,
46
+ starsine,
47
+ noiseonf,
48
+ nophase,
49
+ quantizephase,
50
+ swapphase,
51
+ )
52
+
53
+ # Utilities
54
+ from .utilities import (
55
+ replacenan,
56
+ fillnan,
57
+ hysthresh,
58
+ imgnormalise,
59
+ imgnormalize,
60
+ histtruncate,
61
+ )
62
+
63
+ __version__ = "0.2.3"
64
+
65
+ __all__ = [
66
+ # Phase congruency
67
+ "phasecongmono",
68
+ "phasesymmono",
69
+ "ppdrc",
70
+ "highpassmonogenic",
71
+ "bandpassmonogenic",
72
+ "gaborconvolve",
73
+ "monofilt",
74
+ "phasecong3",
75
+ "phasesym",
76
+ "ppdenoise",
77
+ # Frequency filters
78
+ "filtergrid",
79
+ "filtergrids",
80
+ "gridangles",
81
+ "cosineangularfilter",
82
+ "gaussianangularfilter",
83
+ "lowpassfilter",
84
+ "highpassfilter",
85
+ "bandpassfilter",
86
+ "highboostfilter",
87
+ "loggabor",
88
+ "monogenicfilters",
89
+ "packedmonogenicfilters",
90
+ "perfft2",
91
+ "geoseries",
92
+ # Synthetic images
93
+ "step2line",
94
+ "circsine",
95
+ "starsine",
96
+ "noiseonf",
97
+ "nophase",
98
+ "quantizephase",
99
+ "swapphase",
100
+ # Utilities
101
+ "replacenan",
102
+ "fillnan",
103
+ "hysthresh",
104
+ "imgnormalise",
105
+ "imgnormalize",
106
+ "histtruncate",
107
+ ]