From 2a75b78838112d214a3ac44ddde49239a099d05b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Scho=CC=88nberger?= Date: Tue, 10 Jul 2012 19:36:32 +0200 Subject: [PATCH] change arguments of function estimate_transformation --- skimage/transform/geometric.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/skimage/transform/geometric.py b/skimage/transform/geometric.py index abe27d4c..68f2dae8 100644 --- a/skimage/transform/geometric.py +++ b/skimage/transform/geometric.py @@ -273,7 +273,7 @@ ESTIMATED_TRANSFORMATIONS = { } -def estimate_transformation(ttype, *args, **kwargs): +def estimate_transformation(ttype, src, dst, order=None): """Estimate 2D geometric transformation parameters. You can determine the over-, well- and under-determined parameters @@ -322,7 +322,10 @@ def estimate_transformation(ttype, *args, **kwargs): if ttype not in ESTIMATED_TRANSFORMATIONS: raise NotImplemented('the transformation type \'%s\' is not' 'implemented' % ttype) - matrix = ESTIMATED_TRANSFORMATIONS[ttype][0](*args, **kwargs) + args = [src, dst] + if order is not None and ttype == 'polynomial': + args.append(order) + matrix = ESTIMATED_TRANSFORMATIONS[ttype][0](*args) transform_func = ESTIMATED_TRANSFORMATIONS[ttype][1] return GeometricTransformation(ttype, matrix, transform_func)