We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db584d8 commit 56affe2Copy full SHA for 56affe2
ocrd_cis/ocropy/resegment.py
@@ -1,6 +1,7 @@
1
from __future__ import absolute_import
2
3
import os.path
4
+from itertools import chain
5
import numpy as np
6
from skimage import draw
7
from shapely.geometry import Polygon, asPolygon, LineString
@@ -482,6 +483,10 @@ def join_polygons(polygons, loc=''):
482
483
# compoundp = unary_union(polygons)
484
# jointp = compoundp.convex_hull
485
LOG = getLogger('processor.OcropyResegment')
486
+ polygons = list(chain.from_iterable([
487
+ poly.geoms if poly.type in ['MultiPolygon', 'GeometryCollection']
488
+ else [poly]
489
+ for poly in polygons]))
490
if len(polygons) == 1:
491
return polygons[0]
492
# get equidistant list of points along hull
0 commit comments