print(fname)
seg = xml.parse_alto(fname)
im = Image.open(seg["image"]).convert("L")
im = Image.open(seg["image"]).convert("L")
scal_im = _fixed_resize(im, (1200, 0))
scale = np.divide(im.size, scal_im.size)
scal_bls = scale_polygonal_lines([(x["baseline"], x["boundary"]) for x in seg["lines"]], 1/scale)
scal_bls = [x[0] for x in scal_bls]
After Change
for x in seg["lines"]:
bl = x["baseline"] if x["baseline"] is not None else [0, 0]
pl = x["boundary"] if x["boundary"] is not None else [0, 0]
l.append((bl, pl))
scal_bls = scale_polygonal_lines(l, 1/scale)
scal_bls = [x[0] for x in scal_bls]
o = calculate_polygonal_environment(scal_im, scal_bls)