Fixed shebangs, added error checking

This commit is contained in:
Moshe Kaplan
2013-03-06 01:41:02 -05:00
parent c0ba0c9099
commit bd042d9cc3
48 changed files with 310 additions and 129 deletions

View File

@@ -1,4 +1,4 @@
#/usr/bin/env python
#!/usr/bin/env python
'''
Wiener deconvolution.
@@ -32,6 +32,8 @@ Examples:
import numpy as np
import cv2
# local module
from common import nothing
@@ -65,12 +67,18 @@ if __name__ == '__main__':
import sys, getopt
opts, args = getopt.getopt(sys.argv[1:], '', ['circle', 'angle=', 'd=', 'snr='])
opts = dict(opts)
try: fn = args[0]
except: fn = 'data/licenseplate_motion.jpg'
try:
fn = args[0]
except:
fn = 'data/licenseplate_motion.jpg'
win = 'deconvolution'
img = cv2.imread(fn, 0)
if img is None:
print 'Failed to load fn1:', fn1
sys.exit(1)
img = np.float32(img)/255.0
cv2.imshow('input', img)