pipeline: fix bbox coordinates

This commit is contained in:
James R. Barlow 2018-10-29 22:26:37 -07:00
parent 93623b2226
commit 7acd75f013

View File

@ -593,9 +593,9 @@ def select_ocr_image(
bbox = textarea
xscale, yscale = float(xres) / 72.0, float(yres) / 72.0
pixcoords = [bbox[0] * xscale,
im.height - bbox[1] * yscale,
im.height - bbox[3] * yscale,
bbox[2] * xscale,
im.height - bbox[3] * yscale]
im.height - bbox[1] * yscale]
pixcoords = [int(round(c)) for c in pixcoords]
log.debug('blanking %r', pixcoords)
draw.rectangle(pixcoords, fill=white)