|
|
|
@ -2066,7 +2066,7 @@ class textline_detector:
|
|
|
|
|
gc.collect()
|
|
|
|
|
t2=time.time()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
try:
|
|
|
|
|
# extract text regions and corresponding contours and surrounding box
|
|
|
|
|
text_regions=self.extract_text_regions(image_page)
|
|
|
|
@ -2149,6 +2149,13 @@ class textline_detector:
|
|
|
|
|
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) )
|
|
|
|
|
except:
|
|
|
|
|
contours=[]
|
|
|
|
|
order_of_texts=None
|
|
|
|
|
id_of_texts=None
|
|
|
|
|
self.write_into_page_xml(contours,page_coord,self.dir_out , order_of_texts , id_of_texts)
|
|
|
|
|
print( "time total = "+"{0:.2f}".format(time.time()-t1) )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|