mirror of
https://github.com/qurator-spk/eynollah.git
synced 2026-05-01 03:32:00 +02:00
skip deskewing if no textlines
This commit is contained in:
parent
7b5aa2a1f6
commit
b63e073121
1 changed files with 4 additions and 1 deletions
|
|
@ -1631,6 +1631,10 @@ class Eynollah:
|
||||||
return textline_mask_tot_ea, textline_conf
|
return textline_mask_tot_ea, textline_conf
|
||||||
|
|
||||||
def run_deskew(self, textline_mask_tot_ea):
|
def run_deskew(self, textline_mask_tot_ea):
|
||||||
|
if not np.any(textline_mask_tot_ea):
|
||||||
|
self.logger.info("slope_deskew: empty page")
|
||||||
|
return 0
|
||||||
|
|
||||||
#print(textline_mask_tot_ea.shape, 'textline_mask_tot_ea deskew')
|
#print(textline_mask_tot_ea.shape, 'textline_mask_tot_ea deskew')
|
||||||
slope_deskew = return_deskew_slop(cv2.erode(textline_mask_tot_ea, KERNEL, iterations=2), 2, 30, True,
|
slope_deskew = return_deskew_slop(cv2.erode(textline_mask_tot_ea, KERNEL, iterations=2), 2, 30, True,
|
||||||
logger=self.logger, plotter=self.plotter)
|
logger=self.logger, plotter=self.plotter)
|
||||||
|
|
@ -2354,7 +2358,6 @@ class Eynollah:
|
||||||
t1 = time.time()
|
t1 = time.time()
|
||||||
self.logger.info("Step 2/5: Layout Analysis")
|
self.logger.info("Step 2/5: Layout Analysis")
|
||||||
|
|
||||||
self.logger.info("Using light version processing")
|
|
||||||
(text_regions_p_1,
|
(text_regions_p_1,
|
||||||
erosion_hurts,
|
erosion_hurts,
|
||||||
polygons_seplines,
|
polygons_seplines,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue