Mercurial > hg > config
comparison python/clean_whiteboard.py @ 660:f77be2334246
STUB: python/clean_whiteboard.py
| author | Jeff Hammel <k0scist@gmail.com> |
|---|---|
| date | Thu, 03 Apr 2014 16:41:21 -0700 |
| parents | e5be32fea639 |
| children | 1453c8a3747e |
comparison
equal
deleted
inserted
replaced
| 659:e5be32fea639 | 660:f77be2334246 |
|---|---|
| 17 here = os.path.dirname(os.path.realpath(__file__)) | 17 here = os.path.dirname(os.path.realpath(__file__)) |
| 18 string = (str, unicode) | 18 string = (str, unicode) |
| 19 | 19 |
| 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', nargs='?', | 24 parser.add_argument('input', |
| 25 type=argparse.FileType('r'), default=sys.stdin, | 25 type=argparse.FileType('r'), |
| 26 help='input file, or read from stdin if ommitted') | 26 help='input file') |
| 27 options = parser.parse_args(args) | 27 parser.add_argument('-o', '--output' dest='output', |
| 28 type=argparse.FileType('w'), default=sys.stdout, | |
| 29 help='output file or stdout') | |
| 30 options = parser.parse_args(args) | |
| 28 | 31 |
| 29 if __name__ == '__main__': | 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 main() | 33 |
| 34 if __name__ == '__main__': | |
| 35 main() |
