Skip to content

Commit 4dca5c8

Browse files
authored
Merge pull request #31 from zygmuntszpak/update_tests
Changes equality to approximate equality in test set
2 parents 7037876 + 3a26407 commit 4dca5c8

8 files changed

+10
-10
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "HistogramThresholding"
22
uuid = "2c695a8d-9458-5d45-9878-1b8a99cf7853"
33
authors = ["Dr. Zygmunt L. Szpak <[email protected]>"]
4-
version = "0.2.2"
4+
version = "0.2.3"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

docs/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
33

44
[compat]
5-
Documenter = "~0.21"
5+
Documenter = "~0.23"

test/balancedthreshold.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
img = testimage("moonsurface")
1111
edges, counts = build_histogram(img, 256)
1212
t = find_threshold(Balanced(), counts[1:end], edges)
13-
@test t == 0.5530790786724538
13+
@test t 0.5530790786724538
1414

1515
# Call function and determine threshold on cameraman image
1616
img = testimage("cameraman")
1717
edges, counts = build_histogram(img, 256)
1818
t = find_threshold(Balanced(), counts[1:end], edges)
19-
@test t == 0.16796875
19+
@test t 0.16796875
2020

2121
end

test/entropy_thresholding.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
img = testimage("cameraman")
33
edges, histogram = build_histogram(img,256)
44
@test_throws ErrorException find_threshold(Entropy(),histogram,edges)
5-
@test find_threshold(Entropy(),histogram[1:256],edges) == 0.76171875
5+
@test find_threshold(Entropy(),histogram[1:256],edges) 0.76171875
66

77
img = testimage("mandril_gray")
88
edges, histogram = build_histogram(img,256)
9-
@test find_threshold(Entropy(),histogram[1:256],edges) == 0.408517187461257
9+
@test find_threshold(Entropy(),histogram[1:256],edges) 0.408517187461257
1010

1111
end

test/intermodes.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
img = testimage("cameraman")
1818
edges, counts = build_histogram(img, 256)
1919
t = find_threshold(Intermodes(), counts[1:end], edges)
20-
@test t == 0.34765625
20+
@test t 0.34765625
2121

2222
end

test/minimum.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
img = testimage("cameraman")
1818
edges, counts = build_histogram(img, 256)
1919
t = find_threshold(MinimumIntermodes(), counts[1:end], edges)
20-
@test t == 0.296875
20+
@test t 0.296875
2121

2222

2323
end

test/otsu.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
img = testimage("cameraman")
1414
edges, counts = build_histogram(img, 256)
1515
t = find_threshold(Otsu(), counts[1:end], edges)
16-
@test t == 0.33984375
16+
@test t 0.33984375
1717

1818
end

test/unimodal.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
img = testimage("moonsurface")
1414
edges, samples = build_histogram(img, 256)
1515
t = find_threshold(UnimodalRosin(),samples[1:end], edges)
16-
@test t == 0.5530790786724538
16+
@test t 0.5530790786724538
1717

1818
#= Tests a histogram that resembles a unimodal image, using a
1919
surge function. Also tests the scenario in which there are no bins

0 commit comments

Comments
 (0)