Mercurial > hg > config
comparison python/clean_whiteboard.py @ 661:1453c8a3747e
STUB: python/clean_whiteboard.py
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Thu, 03 Apr 2014 17:31:43 -0700 |
parents | f77be2334246 |
children |
comparison
equal
deleted
inserted
replaced
660:f77be2334246 | 661:1453c8a3747e |
---|---|
20 def main(args=sys.argv[1:]): | 20 def main(args=sys.argv[1:]): |
21 | 21 |
22 # parse command line | 22 # parse command line |
23 parser = argparse.ArgumentParser(description=__doc__) | 23 parser = argparse.ArgumentParser(description=__doc__) |
24 parser.add_argument('input', | 24 parser.add_argument('input', |
25 type=argparse.FileType('r'), | |
26 help='input file') | 25 help='input file') |
27 parser.add_argument('-o', '--output' dest='output', | 26 parser.add_argument('output', |
28 type=argparse.FileType('w'), default=sys.stdout, | 27 help='output file') |
29 help='output file or stdout') | |
30 options = parser.parse_args(args) | 28 options = parser.parse_args(args) |
31 | 29 |
32 subprocess.check_call(['convert', options.input, '-morphology', 'Convolve', 'DoG:15,100,0', '-negate', '-normalize', '-blur', '0x1', '-channel', 'RBG', '-level', '60%,91%,0.1', options.output]) | 30 subprocess.check_call(['convert', options.input, '-morphology', 'Convolve', 'DoG:15,100,0', '-negate', '-normalize', '-blur', '0x1', '-channel', 'RBG', '-level', '60%,91%,0.1', options.output]) |
33 | 31 |
34 if __name__ == '__main__': | 32 if __name__ == '__main__': |