From 2112bb18c67d96feda61486d3d5cadab4ba2a9d5 Mon Sep 17 00:00:00 2001 From: "Rezanezhad, Vahid" Date: Fri, 29 Nov 2019 11:29:12 +0100 Subject: [PATCH] fixed the bug: local variable 't4' referenced before assignment --- qurator/sbb_textline_detector/main.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/qurator/sbb_textline_detector/main.py b/qurator/sbb_textline_detector/main.py index 1f78aaf..e70e475 100644 --- a/qurator/sbb_textline_detector/main.py +++ b/qurator/sbb_textline_detector/main.py @@ -1460,10 +1460,11 @@ class textlineerkenner: print( "time total = "+"{0:.2f}".format(time.time()-t1) ) print( "time needed for page extraction = "+"{0:.2f}".format(t2-t1) ) print( "time needed for text region extraction and get contours = "+"{0:.2f}".format(t3-t2) ) - print( "time needed for textlines = "+"{0:.2f}".format(t4-t3) ) - print( "time needed to get slopes of regions (deskewing) = "+"{0:.2f}".format(t5-t4) ) - print( "time needed to get order of regions = "+"{0:.2f}".format(t6-t5) ) - print( "time needed to implement deskewing = "+"{0:.2f}".format(t7-t6) ) + if len(contours)>0: + print( "time needed for textlines = "+"{0:.2f}".format(t4-t3) ) + print( "time needed to get slopes of regions (deskewing) = "+"{0:.2f}".format(t5-t4) ) + print( "time needed to get order of regions = "+"{0:.2f}".format(t6-t5) ) + print( "time needed to implement deskewing = "+"{0:.2f}".format(t7-t6) )