mirror of
https://github.com/qurator-spk/eynollah.git
synced 2026-05-01 03:32:00 +02:00
writer: also annotate page-level deskewing result
This commit is contained in:
parent
2da718f76f
commit
e3720d6623
2 changed files with 7 additions and 0 deletions
|
|
@ -2325,6 +2325,7 @@ class Eynollah:
|
||||||
pcgts = writer.build_pagexml_no_full_layout(
|
pcgts = writer.build_pagexml_no_full_layout(
|
||||||
found_polygons_text_region=[],
|
found_polygons_text_region=[],
|
||||||
page_coord=page_coord,
|
page_coord=page_coord,
|
||||||
|
page_slope=slope_deskew,
|
||||||
order_of_texts=[],
|
order_of_texts=[],
|
||||||
all_found_textline_polygons=[],
|
all_found_textline_polygons=[],
|
||||||
found_polygons_images=[],
|
found_polygons_images=[],
|
||||||
|
|
@ -2614,6 +2615,7 @@ class Eynollah:
|
||||||
found_polygons_text_region=polygons_of_textregions,
|
found_polygons_text_region=polygons_of_textregions,
|
||||||
found_polygons_text_region_h=polygons_of_textregions_h,
|
found_polygons_text_region_h=polygons_of_textregions_h,
|
||||||
page_coord=page_coord,
|
page_coord=page_coord,
|
||||||
|
page_slope=slope_deskew,
|
||||||
order_of_texts=order_text_new,
|
order_of_texts=order_text_new,
|
||||||
all_found_textline_polygons=all_found_textline_polygons,
|
all_found_textline_polygons=all_found_textline_polygons,
|
||||||
all_found_textline_polygons_h=all_found_textline_polygons_h,
|
all_found_textline_polygons_h=all_found_textline_polygons_h,
|
||||||
|
|
@ -2642,6 +2644,7 @@ class Eynollah:
|
||||||
pcgts = writer.build_pagexml_no_full_layout(
|
pcgts = writer.build_pagexml_no_full_layout(
|
||||||
found_polygons_text_region=polygons_of_textregions,
|
found_polygons_text_region=polygons_of_textregions,
|
||||||
page_coord=page_coord,
|
page_coord=page_coord,
|
||||||
|
page_slope=slope_deskew,
|
||||||
order_of_texts=order_text_new,
|
order_of_texts=order_text_new,
|
||||||
all_found_textline_polygons=all_found_textline_polygons,
|
all_found_textline_polygons=all_found_textline_polygons,
|
||||||
found_polygons_images=polygons_of_images,
|
found_polygons_images=polygons_of_images,
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ class EynollahXmlWriter:
|
||||||
*,
|
*,
|
||||||
found_polygons_text_region,
|
found_polygons_text_region,
|
||||||
page_coord,
|
page_coord,
|
||||||
|
page_slope,
|
||||||
order_of_texts,
|
order_of_texts,
|
||||||
all_found_textline_polygons,
|
all_found_textline_polygons,
|
||||||
found_polygons_images,
|
found_polygons_images,
|
||||||
|
|
@ -100,6 +101,7 @@ class EynollahXmlWriter:
|
||||||
found_polygons_text_region=found_polygons_text_region,
|
found_polygons_text_region=found_polygons_text_region,
|
||||||
found_polygons_text_region_h=[],
|
found_polygons_text_region_h=[],
|
||||||
page_coord=page_coord,
|
page_coord=page_coord,
|
||||||
|
page_slope=page_slope,
|
||||||
order_of_texts=order_of_texts,
|
order_of_texts=order_of_texts,
|
||||||
all_found_textline_polygons=all_found_textline_polygons,
|
all_found_textline_polygons=all_found_textline_polygons,
|
||||||
all_found_textline_polygons_h=[],
|
all_found_textline_polygons_h=[],
|
||||||
|
|
@ -132,6 +134,7 @@ class EynollahXmlWriter:
|
||||||
found_polygons_text_region,
|
found_polygons_text_region,
|
||||||
found_polygons_text_region_h,
|
found_polygons_text_region_h,
|
||||||
page_coord,
|
page_coord,
|
||||||
|
page_slope,
|
||||||
order_of_texts,
|
order_of_texts,
|
||||||
all_found_textline_polygons,
|
all_found_textline_polygons,
|
||||||
all_found_textline_polygons_h,
|
all_found_textline_polygons_h,
|
||||||
|
|
@ -168,6 +171,7 @@ class EynollahXmlWriter:
|
||||||
pcgts = self.pcgts if self.pcgts else create_page_xml(
|
pcgts = self.pcgts if self.pcgts else create_page_xml(
|
||||||
self.image_filename, self.image_height, self.image_width)
|
self.image_filename, self.image_height, self.image_width)
|
||||||
page = pcgts.get_Page()
|
page = pcgts.get_Page()
|
||||||
|
page.set_orientation(-page_slope)
|
||||||
if len(cont_page):
|
if len(cont_page):
|
||||||
page.set_Border(BorderType(Coords=CoordsType(points=self.calculate_points(cont_page[0]))))
|
page.set_Border(BorderType(Coords=CoordsType(points=self.calculate_points(cont_page[0]))))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue