-
Notifications
You must be signed in to change notification settings - Fork 38
/
test_image_processing.py
60 lines (44 loc) · 1.51 KB
/
test_image_processing.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from aotools import image_processing
import numpy
def test_image_contrast():
image = numpy.random.random((20, 20))
contrast = image_processing.image_contrast(image)
assert type(contrast) == float
def test_rms_contrast():
image = numpy.random.random((20, 20))
contrast = image_processing.rms_contrast(image)
assert type(contrast) == float
def test_encircled_energy():
data = numpy.random.rand(32, 32)
ee50d = image_processing.encircled_energy(data)
print(ee50d)
assert type(ee50d) == float
def test_encircled_energy_func():
data = numpy.random.rand(32, 32)
x, y = image_processing.encircled_energy(data, eeDiameter=False)
print(y.min(), y.max())
assert len(x) == len(y)
assert numpy.max(y) <= 1
assert numpy.min(y) >= 0
def test_azimuthal_average():
data = numpy.random.rand(32, 32)
azi = image_processing.azimuthal_average(data)
print(azi.shape)
assert azi.shape == (16,)
def test_encircledEnergy():
data = numpy.random.rand(32, 32)
ee50d = image_processing.encircled_energy(data)
print(ee50d)
assert type(ee50d) == float
def test_encircledEnergy_func():
data = numpy.random.rand(32, 32)
x, y = image_processing.encircled_energy(data, eeDiameter=False)
print(y.min(), y.max())
assert len(x) == len(y)
assert numpy.max(y) <= 1
assert numpy.min(y) >= 0
def test_aziAvg():
data = numpy.random.rand(32, 32)
azi = image_processing.azimuthal_average(data)
print(azi.shape)
assert azi.shape == (16,)