bmnd 0.3.0__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.
- bmnd-0.3.0/LICENSE +21 -0
- bmnd-0.3.0/PKG-INFO +74 -0
- bmnd-0.3.0/README.md +50 -0
- bmnd-0.3.0/pyproject.toml +43 -0
- bmnd-0.3.0/setup.cfg +4 -0
- bmnd-0.3.0/src/bmnd/__init__.py +35 -0
- bmnd-0.3.0/src/bmnd/aggregationweights.py +800 -0
- bmnd-0.3.0/src/bmnd/blockmatching.py +1511 -0
- bmnd-0.3.0/src/bmnd/bmndalgo.py +1063 -0
- bmnd-0.3.0/src/bmnd/cache.py +527 -0
- bmnd-0.3.0/src/bmnd/enums.py +80 -0
- bmnd-0.3.0/src/bmnd/groupfiltering.py +138 -0
- bmnd-0.3.0/src/bmnd/patchaggregation.py +496 -0
- bmnd-0.3.0/src/bmnd/poisson.py +265 -0
- bmnd-0.3.0/src/bmnd/profiles.py +405 -0
- bmnd-0.3.0/src/bmnd/profilevalidation.py +456 -0
- bmnd-0.3.0/src/bmnd/psd.py +261 -0
- bmnd-0.3.0/src/bmnd/sharpening.py +23 -0
- bmnd-0.3.0/src/bmnd/shifts.py +753 -0
- bmnd-0.3.0/src/bmnd/sigmaestimation.py +93 -0
- bmnd-0.3.0/src/bmnd/transforms.py +1204 -0
- bmnd-0.3.0/src/bmnd/utils.py +31 -0
- bmnd-0.3.0/src/bmnd/variance.py +2106 -0
- bmnd-0.3.0/src/bmnd/wiener.py +988 -0
- bmnd-0.3.0/src/bmnd.egg-info/PKG-INFO +74 -0
- bmnd-0.3.0/src/bmnd.egg-info/SOURCES.txt +46 -0
- bmnd-0.3.0/src/bmnd.egg-info/dependency_links.txt +1 -0
- bmnd-0.3.0/src/bmnd.egg-info/requires.txt +10 -0
- bmnd-0.3.0/src/bmnd.egg-info/top_level.txt +1 -0
- bmnd-0.3.0/tests/test_aggregationweights_unit.py +356 -0
- bmnd-0.3.0/tests/test_blockmatching_internal_unit.py +353 -0
- bmnd-0.3.0/tests/test_blockmatching_unit.py +200 -0
- bmnd-0.3.0/tests/test_bmnd_pipeline_unit.py +1052 -0
- bmnd-0.3.0/tests/test_bmnd_robustness.py +67 -0
- bmnd-0.3.0/tests/test_bmnd_smoke.py +79 -0
- bmnd-0.3.0/tests/test_cache_unit.py +74 -0
- bmnd-0.3.0/tests/test_group_filtering_unit.py +114 -0
- bmnd-0.3.0/tests/test_patchaggregation_internal_unit.py +357 -0
- bmnd-0.3.0/tests/test_patchaggregation_unit.py +30 -0
- bmnd-0.3.0/tests/test_poisson_unit.py +156 -0
- bmnd-0.3.0/tests/test_sharpening_unit.py +38 -0
- bmnd-0.3.0/tests/test_shifts_unit.py +361 -0
- bmnd-0.3.0/tests/test_sigmaestimation_unit.py +58 -0
- bmnd-0.3.0/tests/test_transforms_extended_unit.py +112 -0
- bmnd-0.3.0/tests/test_transforms_unit.py +49 -0
- bmnd-0.3.0/tests/test_utils_internal_unit.py +26 -0
- bmnd-0.3.0/tests/test_utils_unit.py +24 -0
- bmnd-0.3.0/tests/test_variance_unit.py +1898 -0
bmnd-0.3.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Christof Duhme
|
|
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.
|
bmnd-0.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: bmnd
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Direct Poisson Denoising by N-Dimensional Block-Matching and Collaborative Filtering
|
|
5
|
+
Author-email: Christof Duhme <c_duhm02@uni-muenster.de>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Classifier: Development Status :: 3 - Alpha
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Topic :: Scientific/Engineering :: Image Processing
|
|
11
|
+
Requires-Python: >=3.11
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: numba
|
|
15
|
+
Requires-Dist: numpy
|
|
16
|
+
Requires-Dist: PyWavelets
|
|
17
|
+
Requires-Dist: scipy
|
|
18
|
+
Provides-Extra: test
|
|
19
|
+
Requires-Dist: pytest; extra == "test"
|
|
20
|
+
Requires-Dist: scikit-image; extra == "test"
|
|
21
|
+
Requires-Dist: bm3d; extra == "test"
|
|
22
|
+
Requires-Dist: bm4d; extra == "test"
|
|
23
|
+
Dynamic: license-file
|
|
24
|
+
|
|
25
|
+
# Direct Poisson Denoising by N-Dimensional Block-Matching and Collaborative Filtering
|
|
26
|
+
|
|
27
|
+
BMND is an algorithm for denoising of Poisson corrupted n-dimensional data.
|
|
28
|
+
|
|
29
|
+
This implementation is based on the paper
|
|
30
|
+
```
|
|
31
|
+
Christof Duhme, Lars Schiefelbein, Florian Büther and Xiaoyi Jiang,
|
|
32
|
+
''BMND: Direct Poisson Denoising by N-Dimensional Block-Matching and Collaborative Filtering'',
|
|
33
|
+
In: arXiv preprint arxiv:DOI, 2026.
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The basic algorithms we build upon are BM3D/BM4D, introduced and developed in these publications:
|
|
37
|
+
```
|
|
38
|
+
Kostadin Dabov, Alessandro Foi, Vladimir Katkovnik and Karen Egiazarian,
|
|
39
|
+
''Image Denoising by Sparse 3-D Transform-Domain Collaborative Filtering'',
|
|
40
|
+
In: IEEE Transactions on Image Processing, vol. 16, no. 8, pp. 2080-2095, 2007.
|
|
41
|
+
DOI: 10.1109/TIP.2007.901238.
|
|
42
|
+
|
|
43
|
+
Matteo Maggioni, Vladimir Katkovnik, Karen Egiazarian and Alessandro Foi,
|
|
44
|
+
''A Nonlocal Transform-Domain Filter for Volumetric Data Denoising and Reconstruction'',
|
|
45
|
+
In: IEEE Transactions on Image Processing, vol. 22, no. 1, pp. 119-133, 2013.
|
|
46
|
+
DOI: 10.1109/TIP.2012.2210725.
|
|
47
|
+
|
|
48
|
+
Ymir Mäkinen, Lucio Azzari and Alessandro Foi,
|
|
49
|
+
''Collaborative Filtering of Correlated Noise: Exact Transform-Domain Variance for Improved Shrinkage and Patch Matching'',
|
|
50
|
+
In: IEEE Transactions on Image Processing, vol. 29, pp. 8339-8354, 2020.
|
|
51
|
+
DOI: 10.1109/TIP.2020.3014721.
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Usage
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
import numpy as np
|
|
58
|
+
from bmnd import BM3DProfile, NoiseModel, bmnd
|
|
59
|
+
|
|
60
|
+
# Generate a synthetic 2D image with Poisson noise.
|
|
61
|
+
image = np.full((64, 64), 5.0, dtype=np.float32)
|
|
62
|
+
image[16:48, 16:48] = 20.0
|
|
63
|
+
noisy = np.random.default_rng(0).poisson(image).astype(np.float32)
|
|
64
|
+
|
|
65
|
+
profile = BM3DProfile(noise_model=NoiseModel.POISSON)
|
|
66
|
+
denoised = bmnd(noisy, profile)
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
For your own data, replace `noisy` with a non-negative NumPy array in count
|
|
70
|
+
units, without normalizing it to `[0, 1]`. No noise standard deviation is needed
|
|
71
|
+
for Poisson denoising. The output has the same shape as the input.
|
|
72
|
+
|
|
73
|
+
We provide `BM3DProfile` for 2D images and `BM4DProfile` for 3D volumes to match
|
|
74
|
+
the original algorithms defaults.
|
bmnd-0.3.0/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Direct Poisson Denoising by N-Dimensional Block-Matching and Collaborative Filtering
|
|
2
|
+
|
|
3
|
+
BMND is an algorithm for denoising of Poisson corrupted n-dimensional data.
|
|
4
|
+
|
|
5
|
+
This implementation is based on the paper
|
|
6
|
+
```
|
|
7
|
+
Christof Duhme, Lars Schiefelbein, Florian Büther and Xiaoyi Jiang,
|
|
8
|
+
''BMND: Direct Poisson Denoising by N-Dimensional Block-Matching and Collaborative Filtering'',
|
|
9
|
+
In: arXiv preprint arxiv:DOI, 2026.
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The basic algorithms we build upon are BM3D/BM4D, introduced and developed in these publications:
|
|
13
|
+
```
|
|
14
|
+
Kostadin Dabov, Alessandro Foi, Vladimir Katkovnik and Karen Egiazarian,
|
|
15
|
+
''Image Denoising by Sparse 3-D Transform-Domain Collaborative Filtering'',
|
|
16
|
+
In: IEEE Transactions on Image Processing, vol. 16, no. 8, pp. 2080-2095, 2007.
|
|
17
|
+
DOI: 10.1109/TIP.2007.901238.
|
|
18
|
+
|
|
19
|
+
Matteo Maggioni, Vladimir Katkovnik, Karen Egiazarian and Alessandro Foi,
|
|
20
|
+
''A Nonlocal Transform-Domain Filter for Volumetric Data Denoising and Reconstruction'',
|
|
21
|
+
In: IEEE Transactions on Image Processing, vol. 22, no. 1, pp. 119-133, 2013.
|
|
22
|
+
DOI: 10.1109/TIP.2012.2210725.
|
|
23
|
+
|
|
24
|
+
Ymir Mäkinen, Lucio Azzari and Alessandro Foi,
|
|
25
|
+
''Collaborative Filtering of Correlated Noise: Exact Transform-Domain Variance for Improved Shrinkage and Patch Matching'',
|
|
26
|
+
In: IEEE Transactions on Image Processing, vol. 29, pp. 8339-8354, 2020.
|
|
27
|
+
DOI: 10.1109/TIP.2020.3014721.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
```python
|
|
33
|
+
import numpy as np
|
|
34
|
+
from bmnd import BM3DProfile, NoiseModel, bmnd
|
|
35
|
+
|
|
36
|
+
# Generate a synthetic 2D image with Poisson noise.
|
|
37
|
+
image = np.full((64, 64), 5.0, dtype=np.float32)
|
|
38
|
+
image[16:48, 16:48] = 20.0
|
|
39
|
+
noisy = np.random.default_rng(0).poisson(image).astype(np.float32)
|
|
40
|
+
|
|
41
|
+
profile = BM3DProfile(noise_model=NoiseModel.POISSON)
|
|
42
|
+
denoised = bmnd(noisy, profile)
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
For your own data, replace `noisy` with a non-negative NumPy array in count
|
|
46
|
+
units, without normalizing it to `[0, 1]`. No noise standard deviation is needed
|
|
47
|
+
for Poisson denoising. The output has the same shape as the input.
|
|
48
|
+
|
|
49
|
+
We provide `BM3DProfile` for 2D images and `BM4DProfile` for 3D volumes to match
|
|
50
|
+
the original algorithms defaults.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "bmnd"
|
|
7
|
+
version = "0.3.0"
|
|
8
|
+
description = "Direct Poisson Denoising by N-Dimensional Block-Matching and Collaborative Filtering"
|
|
9
|
+
authors = [
|
|
10
|
+
{ name="Christof Duhme", email="c_duhm02@uni-muenster.de" },
|
|
11
|
+
]
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.11"
|
|
14
|
+
dependencies = [
|
|
15
|
+
"numba",
|
|
16
|
+
"numpy",
|
|
17
|
+
"PyWavelets",
|
|
18
|
+
"scipy",
|
|
19
|
+
]
|
|
20
|
+
classifiers = [
|
|
21
|
+
"Development Status :: 3 - Alpha",
|
|
22
|
+
"Operating System :: OS Independent",
|
|
23
|
+
"Programming Language :: Python :: 3",
|
|
24
|
+
"Topic :: Scientific/Engineering :: Image Processing",
|
|
25
|
+
]
|
|
26
|
+
license = "MIT"
|
|
27
|
+
license-files = ["LICEN[CS]E*"]
|
|
28
|
+
|
|
29
|
+
[project.optional-dependencies]
|
|
30
|
+
test = [
|
|
31
|
+
"pytest",
|
|
32
|
+
"scikit-image",
|
|
33
|
+
"bm3d",
|
|
34
|
+
"bm4d",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
[tool.setuptools]
|
|
38
|
+
package-dir = {"" = "src"}
|
|
39
|
+
|
|
40
|
+
[tool.black]
|
|
41
|
+
extend-exclude = '''
|
|
42
|
+
(^|/)shifts\.py$
|
|
43
|
+
'''
|
bmnd-0.3.0/setup.cfg
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from .bmndalgo import bmnd
|
|
2
|
+
from .enums import (
|
|
3
|
+
AggregationWeightDomain,
|
|
4
|
+
AggregationWeightModel,
|
|
5
|
+
AggregationWeightScope,
|
|
6
|
+
BlockMatchDistance,
|
|
7
|
+
CacheMode,
|
|
8
|
+
NoiseModel,
|
|
9
|
+
PoissonGroupMassConservation,
|
|
10
|
+
PoissonHTMatchPolicy,
|
|
11
|
+
PoissonVarianceSource,
|
|
12
|
+
PoissonWienerGainMode,
|
|
13
|
+
ReferenceScheduleMode,
|
|
14
|
+
)
|
|
15
|
+
from .profiles import BM2DProfile, BM3DProfile, BM4DProfile, BM5DProfile, BMNDProfile
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
"AggregationWeightDomain",
|
|
19
|
+
"AggregationWeightModel",
|
|
20
|
+
"AggregationWeightScope",
|
|
21
|
+
"BM2DProfile",
|
|
22
|
+
"BM3DProfile",
|
|
23
|
+
"BM4DProfile",
|
|
24
|
+
"BM5DProfile",
|
|
25
|
+
"BMNDProfile",
|
|
26
|
+
"BlockMatchDistance",
|
|
27
|
+
"CacheMode",
|
|
28
|
+
"NoiseModel",
|
|
29
|
+
"PoissonGroupMassConservation",
|
|
30
|
+
"PoissonHTMatchPolicy",
|
|
31
|
+
"PoissonVarianceSource",
|
|
32
|
+
"PoissonWienerGainMode",
|
|
33
|
+
"ReferenceScheduleMode",
|
|
34
|
+
"bmnd",
|
|
35
|
+
]
|