Commit b6aecb75 authored by Michael Murtaugh's avatar Michael Murtaugh

args fix

parent 65e5fe25
......@@ -34,6 +34,12 @@ def ensure_list (f):
return [f]
def tuple_lists(args):
for (key, value) in args.items():
if type(value) == list:
args[key] = tuple(value)
return args
def process_features (grayimg, features):
ret = {}
for x in features:
......@@ -56,12 +62,12 @@ def process_features (grayimg, features):
rects2 = ret[f2['name']]
for (x,y,w,h) in f1['_cascade'].detectMultiScale(roi, **f1['args']):
for (x,y,w,h) in f1['_cascade'].detectMultiScale(roi, **tuple_lists(f1['args'])):
rects.append([int(x), int(y), int(w), int(h)])
# narrow for (evt) next cascaded feature...
if f2:
roi = roi[y:y+h, x:x+w]
for (x2,y2,w2,h2) in f2['_cascade'].detectMultiScale(roi, **f2['args']):
for (x2,y2,w2,h2) in f2['_cascade'].detectMultiScale(roi, **tuple_lists(f2['args'])):
rects2.append([int(x+x2), int(y+y2), int(w2), int(h2)])
return ret
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment