From 29f4873badda018a767bd72eb85d8feef9793905 Mon Sep 17 00:00:00 2001 From: Jesper Zedlitz Date: Thu, 19 Nov 2015 19:57:09 +0100 Subject: [PATCH 1/2] The padding around vertical black separators was too wide. --- ocropus-gpageseg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocropus-gpageseg b/ocropus-gpageseg index 5e043631..9dbbb680 100755 --- a/ocropus-gpageseg +++ b/ocropus-gpageseg @@ -149,7 +149,7 @@ def DSAVE(title,image): def compute_separators_morph(binary,scale): """Finds vertical black lines corresponding to column separators.""" d0 = int(max(5,scale/4)) - d1 = int(max(5,scale))+args.sepwiden + d1 = int(max(5,scale/4)) + args.sepwiden thick = morph.r_dilation(binary,(d0,d1)) vert = morph.rb_opening(thick,(10*scale,1)) vert = morph.r_erosion(vert,(d0//2,args.sepwiden)) From e73d39a7ba2e64193d7636433199e88b7911ad48 Mon Sep 17 00:00:00 2001 From: Jesper Zedlitz Date: Fri, 4 Dec 2015 06:10:54 +0100 Subject: [PATCH 2/2] larger search distance in both x and y direction --- ocropus-gpageseg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocropus-gpageseg b/ocropus-gpageseg index 9dbbb680..dc8abb64 100755 --- a/ocropus-gpageseg +++ b/ocropus-gpageseg @@ -205,7 +205,7 @@ def compute_colseps_conv(binary,scale=1.0): grad = (grad>0.5*amax(grad)) DSAVE("2grad",grad) # combine edges and whitespace - seps = minimum(thresh,maximum_filter(grad,(int(scale),int(5*scale)))) + seps = minimum(thresh,maximum_filter(grad,(int(5*scale),int(5*scale)))) seps = maximum_filter(seps,(int(2*scale),1)) DSAVE("3seps",seps) # select only the biggest column separators