This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import os | |
def main(): | |
# Iterate through all input files | |
filenames = [file for file in os.listdir( | |
os.getcwd()) if file.endswith('.eps')] | |
# Convert all .eps to .png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import fitz | |
import numpy as np | |
import os | |
from fitz.fitz import Matrix | |
CROP_MARGIN = 10 # number of pixels to allow as margin in cropped image, 0 is too tight in many cases | |
IMG_SCALE = 5 # scale factor when turning PDF page into a raster map |