summaryrefslogtreecommitdiff
path: root/wipesides_test.go
diff options
context:
space:
mode:
authorNick White <git@njw.name>2020-07-13 18:09:15 +0100
committerNick White <git@njw.name>2020-07-13 18:17:48 +0100
commit0ceaa5d97b585987539c51b8b8ce0705c06fc3a8 (patch)
treee229f7879ddcd9b4f7165e76733cbb88e3b8718e /wipesides_test.go
parentc3ae25f63823501fc7f92e6e291df60c282be138 (diff)
Improve wiper algorithm
Several changes made to wiper to improve things: - If findbestedge finds more than one 'best' line, choose the middle one, rather than the first. - findbestedge selects the line with the lowest number of black pixels, rather than (erroneously) the highest. - Added a findedgesOutin() function, which finds edges like findedges() but looking from the outside edges of the image inwards, rather than from the inside out. More testing is needed to decide whether this is useful; initial testing showed very little difference, but that was limited to lightly binarised images. This is in use by VWipe() at present, where worries about several gutters thanks to the edges of other pages aren't present. - Added separate vwsize, vthresh and vmin arguments to WipeFile so that vertical wiping can have different parameters (which is very important for good quality vertical wiping). - Updated wiping tests. - Rewrote the wipe cmd to use WipeFile() directly.
Diffstat (limited to 'wipesides_test.go')
-rw-r--r--wipesides_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/wipesides_test.go b/wipesides_test.go
index 7ce3472..d6a9af3 100644
--- a/wipesides_test.go
+++ b/wipesides_test.go
@@ -103,8 +103,8 @@ func TestWipeSides(t *testing.T) {
thresh float64
wsize int
}{
- {"testdata/1727_GREENE_0048.png", 172, 237, 2204, 2244, 0.005, 120},
- {"testdata/1687_SCHWEITZER_0030.png", 142, 231, 2595, 2656, 0.005, 90},
+ {"testdata/1727_GREENE_0048.png", 70, 237, 2204, 2450, 0.005, 120},
+ {"testdata/1687_SCHWEITZER_0030.png", 70, 231, 2595, 2770, 0.005, 90},
}
for _, c := range topbottomedgecases {