mirror of
https://github.com/qurator-spk/eynollah.git
synced 2026-05-01 03:32:00 +02:00
with -slro, also extract and apply page (Border) mask
This commit is contained in:
parent
569b96d1a9
commit
0015f2675b
1 changed files with 7 additions and 2 deletions
|
|
@ -1606,8 +1606,13 @@ class Eynollah:
|
|||
def run_graphics_and_columns_without_layout(self, textline_mask_tot_ea, image):
|
||||
image_page, page_coord, cont_page = self.extract_page(image)
|
||||
|
||||
textline_mask_tot_ea = textline_mask_tot_ea[page_coord[0]: page_coord[1],
|
||||
page_coord[2]: page_coord[3]]
|
||||
mask_page = np.zeros_like(textline_mask_tot_ea)
|
||||
mask_page = cv2.fillPoly(mask_page, pts=[cont_page[0]], color=1)
|
||||
mask_page = mask_page == 0
|
||||
|
||||
textline_mask_tot_ea[mask_page] = 0
|
||||
box = slice(*page_coord[0:2]), slice(*page_coord[2:4])
|
||||
textline_mask_tot_ea = textline_mask_tot_ea[box]
|
||||
|
||||
return page_coord, image_page, textline_mask_tot_ea, cont_page
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue