Mercurial > hg > multiomr
annotate Preprocessing/ossia.py @ 2:46fb79167a61 tip
Main Code
author | Victor Padilla <victor.padilla.mc@gmail.com> |
---|---|
date | Mon, 04 May 2015 22:56:18 +0200 |
parents | |
children |
rev | line source |
---|---|
victor@2 | 1 #!/home/alex/anaconda/bin/python |
victor@2 | 2 |
victor@2 | 3 import sys, getopt |
victor@2 | 4 import preomr |
victor@2 | 5 |
victor@2 | 6 def usage(): |
victor@2 | 7 print "Please provide input and output filenames." |
victor@2 | 8 |
victor@2 | 9 def main(argv): |
victor@2 | 10 if len(argv) < 2: |
victor@2 | 11 usage() |
victor@2 | 12 sys.exit(2) |
victor@2 | 13 infile = argv[0] |
victor@2 | 14 outfile = argv[1] |
victor@2 | 15 |
victor@2 | 16 process(infile, outfile) |
victor@2 | 17 |
victor@2 | 18 |
victor@2 | 19 def process(infile, outfile): |
victor@2 | 20 po = preomr.PreOMR(infile) |
victor@2 | 21 #po.staffline_removal() |
victor@2 | 22 po.remove_ossia() |
victor@2 | 23 po.save(outfile) |
victor@2 | 24 |
victor@2 | 25 # Commandline parameter processing |
victor@2 | 26 # Make working folder |
victor@2 | 27 # Explode PDFs into PNGs? |
victor@2 | 28 # Deskew (optional) |
victor@2 | 29 # Find staves |
victor@2 | 30 # Print output image(s) |
victor@2 | 31 |
victor@2 | 32 if __name__ == "__main__": |
victor@2 | 33 main(sys.argv[1:]) |