victor@2: #!/home/alex/anaconda/bin/python victor@2: #!/home/alex/anaconda/bin/python victor@2: victor@2: import sys, getopt victor@2: import preomr victor@2: victor@2: def usage(): victor@2: print "Please provide input and output filenames." victor@2: victor@2: def main(argv): victor@2: if len(argv) < 3: victor@2: usage() victor@2: sys.exit(2) victor@2: infile = argv[0] victor@2: outfileA = argv[1] victor@2: outfileB = argv[2] victor@2: process(infile, outfileA, outfileB) victor@2: victor@2: def process(infile, outfileA, outfileB): victor@2: po = preomr.PreOMR(infile) victor@2: # TODO make deskewing an option victor@2: #po.deskew() victor@2: #po.staffline_removal() victor@2: rv = po.split_movements(outfileA, outfileB) victor@2: if rv != None: victor@2: print "new movement at position %d" % rv victor@2: sys.exit(0) victor@2: else: victor@2: print "no change of movement detected" victor@2: sys.exit(1) victor@2: victor@2: # Commandline parameter processing victor@2: # Make working folder victor@2: # Explode PDFs into PNGs? victor@2: # Deskew (optional) victor@2: # Find staves victor@2: # Print output image(s) victor@2: victor@2: if __name__ == "__main__": victor@2: main(sys.argv[1:])