Mercurial > hg > config
comparison python/clean_whiteboard.py @ 659:e5be32fea639
https://gist.github.com/lelandbatey/8677901
| author | Jeff Hammel <k0scist@gmail.com> |
|---|---|
| date | Thu, 03 Apr 2014 11:53:23 -0700 |
| parents | |
| children | f77be2334246 |
comparison
equal
deleted
inserted
replaced
| 658:c2e89dafa397 | 659:e5be32fea639 |
|---|---|
| 1 #!/usr/bin/env python | |
| 2 # -*- coding: utf-8 -*- | |
| 3 | |
| 4 """ | |
| 5 From https://gist.github.com/lelandbatey/8677901 | |
| 6 | |
| 7 #!/bin/bash | |
| 8 convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2 | |
| 9 """ | |
| 10 | |
| 11 import argparse | |
| 12 import os | |
| 13 import subprocess | |
| 14 import sys | |
| 15 | |
| 16 __all__ = ['main'] | |
| 17 here = os.path.dirname(os.path.realpath(__file__)) | |
| 18 string = (str, unicode) | |
| 19 | |
| 20 def main(args=sys.argv[1:]): | |
| 21 | |
| 22 # parse command line | |
| 23 parser = argparse.ArgumentParser(description=__doc__) | |
| 24 parser.add_argument('input', nargs='?', | |
| 25 type=argparse.FileType('r'), default=sys.stdin, | |
| 26 help='input file, or read from stdin if ommitted') | |
| 27 options = parser.parse_args(args) | |
| 28 | |
| 29 if __name__ == '__main__': | |
| 30 main() |
