writer: also annotate page-level deskewing result

This commit is contained in:
Robert Sachunsky 2026-04-23 21:07:31 +02:00
parent 2da718f76f
commit e3720d6623
2 changed files with 7 additions and 0 deletions

View file

@ -2325,6 +2325,7 @@ class Eynollah:
pcgts = writer.build_pagexml_no_full_layout(
found_polygons_text_region=[],
page_coord=page_coord,
page_slope=slope_deskew,
order_of_texts=[],
all_found_textline_polygons=[],
found_polygons_images=[],
@ -2614,6 +2615,7 @@ class Eynollah:
found_polygons_text_region=polygons_of_textregions,
found_polygons_text_region_h=polygons_of_textregions_h,
page_coord=page_coord,
page_slope=slope_deskew,
order_of_texts=order_text_new,
all_found_textline_polygons=all_found_textline_polygons,
all_found_textline_polygons_h=all_found_textline_polygons_h,
@ -2642,6 +2644,7 @@ class Eynollah:
pcgts = writer.build_pagexml_no_full_layout(
found_polygons_text_region=polygons_of_textregions,
page_coord=page_coord,
page_slope=slope_deskew,
order_of_texts=order_text_new,
all_found_textline_polygons=all_found_textline_polygons,
found_polygons_images=polygons_of_images,

View file

@ -73,6 +73,7 @@ class EynollahXmlWriter:
*,
found_polygons_text_region,
page_coord,
page_slope,
order_of_texts,
all_found_textline_polygons,
found_polygons_images,
@ -100,6 +101,7 @@ class EynollahXmlWriter:
found_polygons_text_region=found_polygons_text_region,
found_polygons_text_region_h=[],
page_coord=page_coord,
page_slope=page_slope,
order_of_texts=order_of_texts,
all_found_textline_polygons=all_found_textline_polygons,
all_found_textline_polygons_h=[],
@ -132,6 +134,7 @@ class EynollahXmlWriter:
found_polygons_text_region,
found_polygons_text_region_h,
page_coord,
page_slope,
order_of_texts,
all_found_textline_polygons,
all_found_textline_polygons_h,
@ -168,6 +171,7 @@ class EynollahXmlWriter:
pcgts = self.pcgts if self.pcgts else create_page_xml(
self.image_filename, self.image_height, self.image_width)
page = pcgts.get_Page()
page.set_orientation(-page_slope)
if len(cont_page):
page.set_Border(BorderType(Coords=CoordsType(points=self.calculate_points(cont_page[0]))))