From 0ceaa5d97b585987539c51b8b8ce0705c06fc3a8 Mon Sep 17 00:00:00 2001 From: Nick White Date: Mon, 13 Jul 2020 18:09:15 +0100 Subject: 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. --- testdata/pg2_integralwipesides_t0.02_w5.png | Bin 33595 -> 33622 bytes testdata/pg2_integralwipesides_t0.05_w25.png | Bin 33432 -> 33622 bytes testdata/pg2_integralwipesides_t0.05_w5.png | Bin 21695 -> 21735 bytes 3 files changed, 0 insertions(+), 0 deletions(-) (limited to 'testdata') diff --git a/testdata/pg2_integralwipesides_t0.02_w5.png b/testdata/pg2_integralwipesides_t0.02_w5.png index 6b4ccb2..4e8850c 100644 Binary files a/testdata/pg2_integralwipesides_t0.02_w5.png and b/testdata/pg2_integralwipesides_t0.02_w5.png differ diff --git a/testdata/pg2_integralwipesides_t0.05_w25.png b/testdata/pg2_integralwipesides_t0.05_w25.png index 39dc88d..4e8850c 100644 Binary files a/testdata/pg2_integralwipesides_t0.05_w25.png and b/testdata/pg2_integralwipesides_t0.05_w25.png differ diff --git a/testdata/pg2_integralwipesides_t0.05_w5.png b/testdata/pg2_integralwipesides_t0.05_w5.png index 3a0452f..da09eba 100644 Binary files a/testdata/pg2_integralwipesides_t0.05_w5.png and b/testdata/pg2_integralwipesides_t0.05_w5.png differ -- cgit v1.2.1-24-ge1ad