mirror of
https://github.com/qurator-spk/eynollah.git
synced 2026-07-26 05:29:16 +02:00
layout -cl: fix typo (shapely.prepare instead of prepared)
This commit is contained in:
parent
63fbfc01b5
commit
0a53381751
1 changed files with 3 additions and 3 deletions
|
|
@ -11,7 +11,7 @@ try:
|
||||||
except ImportError:
|
except ImportError:
|
||||||
plt = None
|
plt = None
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from shapely import geometry, prepare, ops, plotting
|
from shapely import geometry, prepared, ops
|
||||||
import cv2
|
import cv2
|
||||||
from scipy.signal import find_peaks
|
from scipy.signal import find_peaks
|
||||||
from scipy.ndimage import gaussian_filter1d
|
from scipy.ndimage import gaussian_filter1d
|
||||||
|
|
@ -920,10 +920,10 @@ def small_textlines_to_parent_adherence2(
|
||||||
if geometry.MultiPolygon(textlines_small_poly).intersects(
|
if geometry.MultiPolygon(textlines_small_poly).intersects(
|
||||||
geometry.MultiPolygon(textlines_large_poly)):
|
geometry.MultiPolygon(textlines_large_poly)):
|
||||||
# FIXME: also consider confidence (less certain lines replaced by better ones)...
|
# FIXME: also consider confidence (less certain lines replaced by better ones)...
|
||||||
textlines_large_prep = [prepare(poly) for poly in textlines_large_poly]
|
textlines_large_prep = [prepared.prep(poly) for poly in textlines_large_poly]
|
||||||
textlines_small_indexes_interlarge = []
|
textlines_small_indexes_interlarge = []
|
||||||
for small_poly in textlines_small_poly:
|
for small_poly in textlines_small_poly:
|
||||||
intersections = [small_poly.intersection(prep).area
|
intersections = [small_poly.intersection(prep.context).area
|
||||||
if prep.intersects(small_poly) else 0
|
if prep.intersects(small_poly) else 0
|
||||||
for prep in textlines_large_prep]
|
for prep in textlines_large_prep]
|
||||||
idx_large = np.argmax(intersections)
|
idx_large = np.argmax(intersections)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue