mirror of
https://github.com/qurator-spk/eynollah.git
synced 2025-10-15 19:09:58 +02:00
simplify
(`skip_layout_and_reading_order` is already an attr)
This commit is contained in:
parent
ecb53056f2
commit
c4cb16c2a8
1 changed files with 102 additions and 103 deletions
|
@ -2155,7 +2155,7 @@ class Eynollah:
|
|||
page_coord,
|
||||
cont_page)
|
||||
|
||||
def get_regions_light_v(self,img,is_image_enhanced, num_col_classifier, skip_layout_and_reading_order=False):
|
||||
def get_regions_light_v(self,img,is_image_enhanced, num_col_classifier):
|
||||
self.logger.debug("enter get_regions_light_v")
|
||||
t_in = time.time()
|
||||
erosion_hurts = False
|
||||
|
@ -2221,7 +2221,11 @@ class Eynollah:
|
|||
|
||||
#plt.imshwo(self.image_page_org_size)
|
||||
#plt.show()
|
||||
if not skip_layout_and_reading_order:
|
||||
if self.skip_layout_and_reading_order:
|
||||
img_bin = resize_image(img_bin,img_height_h, img_width_h )
|
||||
self.logger.debug("exit get_regions_light_v")
|
||||
return None, erosion_hurts, None, None, textline_mask_tot_ea, img_bin, None
|
||||
|
||||
#print("inside 2 ", time.time()-t_in)
|
||||
if num_col_classifier == 1 or num_col_classifier == 2:
|
||||
if self.image_org.shape[0]/self.image_org.shape[1] > 2.5:
|
||||
|
@ -2320,10 +2324,6 @@ class Eynollah:
|
|||
textline_mask_tot_ea,
|
||||
img_bin,
|
||||
confidence_matrix)
|
||||
else:
|
||||
img_bin = resize_image(img_bin,img_height_h, img_width_h )
|
||||
self.logger.debug("exit get_regions_light_v")
|
||||
return None, erosion_hurts, None, None, textline_mask_tot_ea, img_bin, None
|
||||
|
||||
def get_regions_from_xy_2models(self,img,is_image_enhanced, num_col_classifier):
|
||||
self.logger.debug("enter get_regions_from_xy_2models")
|
||||
|
@ -4226,8 +4226,7 @@ class Eynollah:
|
|||
self.logger.info("Skipping layout analysis and reading order detection")
|
||||
|
||||
_ ,_, _, _, textline_mask_tot_ea, img_bin_light, _ = \
|
||||
self.get_regions_light_v(img_res, is_image_enhanced, num_col_classifier,
|
||||
skip_layout_and_reading_order=self.skip_layout_and_reading_order)
|
||||
self.get_regions_light_v(img_res, is_image_enhanced, num_col_classifier,)
|
||||
|
||||
page_coord, image_page, textline_mask_tot_ea, img_bin_light, cont_page = \
|
||||
self.run_graphics_and_columns_without_layout(textline_mask_tot_ea, img_bin_light)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue