@@ -52,7 +52,7 @@ def __init__(self, *args, **kwargs):
52
52
self .ocrd_tool = get_ocrd_tool ()
53
53
kwargs ['ocrd_tool' ] = self .ocrd_tool ['tools' ][TOOL ]
54
54
kwargs ['version' ] = self .ocrd_tool ['version' ]
55
- super (OcropyResegment , self ).__init__ (* args , ** kwargs )
55
+ super ().__init__ (* args , ** kwargs )
56
56
57
57
def process (self ):
58
58
"""Resegment lines of the workspace.
@@ -118,7 +118,7 @@ def process(self):
118
118
self .add_metadata (pcgts )
119
119
page_id = pcgts .pcGtsId or input_file .pageId or input_file .ID
120
120
page = pcgts .get_Page ()
121
-
121
+
122
122
page_image , page_coords , page_image_info = self .workspace .image_from_page (
123
123
page , page_id , feature_selector = 'binarized' )
124
124
if self .parameter ['dpi' ] > 0 :
@@ -266,9 +266,9 @@ def _process_segment(self, parent, parent_image, parent_coords, page_id, zoom, l
266
266
continue
267
267
line_polygon = baseline_of_segment (line , parent_coords )
268
268
line_ltr = line_polygon [0 ,0 ] < line_polygon [- 1 ,0 ]
269
- line_polygon = make_valid (LineString (line_polygon ).buffer (
269
+ line_polygon = make_valid (join_polygons ( LineString (line_polygon ).buffer (
270
270
# left-hand side if left-to-right, and vice versa
271
- scale * (- 1 ) ** line_ltr , single_sided = True ))
271
+ scale * (- 1 ) ** line_ltr , single_sided = True ), loc = line . id ) )
272
272
line_polygon = np .array (line_polygon .exterior , np .int )[:- 1 ]
273
273
line_y , line_x = draw .polygon (line_polygon [:, 1 ],
274
274
line_polygon [:, 0 ],
0 commit comments