瀏覽代碼

Hopefully get better skew interpretation ;)

master
Merlijn Wajer 5 年之前
父節點
當前提交
7a5c6a6792
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. +3
    -3
      parse_scandata.py

+ 3
- 3
parse_scandata.py 查看文件

@@ -50,13 +50,13 @@ for r in relevant:

#print(pagetype, orig_file_name, rotation, skew, apply_skew, crop_x, crop_y, crop_w, crop_h)

skew_r = math.radians(-skew)
skew_r = math.radians(skew)

if apply_skew:
top_l = (crop_x, crop_y)
top_r = (crop_x + crop_w * math.cos(skew_r), crop_y + crop_w * math.sin(skew_r))
top_r = (crop_x + crop_w * math.cos(skew_r), crop_y - crop_w * math.sin(skew_r))
bottom_l = (crop_x + crop_h * math.sin(skew_r), crop_y + crop_h * math.cos(skew_r))
bottom_r = (top_r[0], bottom_l[1] + crop_w * math.sin(skew_r))
bottom_r = (top_r[0], bottom_l[1] - crop_w * math.sin(skew_r))
else:
top_l = (crop_x, crop_y)
top_r = (crop_x + crop_w, crop_y)


Loading…
取消
儲存