[python-dtcwt] 436/497: registration: revert to nearest neighbour sampling

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Jul 21 18:06:36 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch debian/sid
in repository python-dtcwt.

commit 8612a3ac7c81087803cb8118aaa9fc50f00d84ce
Author: Rich Wareham <rjw57 at cam.ac.uk>
Date:   Fri Mar 28 16:09:29 2014 +0000

    registration: revert to nearest neighbour sampling
    
    For Qtilde matrices, we were generating registration vectors at the
    wrong scale given the sampling. Fix the size of reg vectors produced and
    we fix the need for bilinear sampling.
---
 dtcwt/registration.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/dtcwt/registration.py b/dtcwt/registration.py
index 9b0ba1b..57a3572 100644
--- a/dtcwt/registration.py
+++ b/dtcwt/registration.py
@@ -314,7 +314,7 @@ def estimatereg(source, reference, regshape=None):
     # Extract number of levels and shape of level 3 subband
     nlevels = len(source.highpasses)
     if regshape is None:
-        avecs_shape = source.highpasses[2].shape[:2] + (6,)
+        avecs_shape = source.highpasses[3].shape[:2] + (6,)
     else:
         avecs_shape = tuple(regshape[:2]) + (6,)
 
@@ -323,7 +323,10 @@ def estimatereg(source, reference, regshape=None):
 
     # Compute initial global transform
     levels = list(x for x in xrange(nlevels-1, nlevels-3, -1) if x>=0)
-    Qt_mats = list(np.sum(np.sum(x, axis=0), axis=0) for x in qtildematrices(source, reference, levels))
+    Qt_mats = list(
+            np.sum(np.sum(x, axis=0), axis=0)
+            for x in qtildematrices(source, reference, levels)
+    )
     Qt = np.sum(Qt_mats, axis=0)
 
     a = solvetransform(Qt)
@@ -347,7 +350,7 @@ def estimatereg(source, reference, regshape=None):
 
         qts = np.zeros(avecs.shape[:2] + all_qts[0].shape[2:])
         for x in all_qts:
-            qts += dtcwt.sampling.rescale(_boxfilter(x, 3), avecs.shape[:2], method='bilinear')
+            qts += dtcwt.sampling.rescale(_boxfilter(x, 3), avecs.shape[:2], method='nearest')
 
         avecs += solvetransform(qts)
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-dtcwt.git



More information about the debian-science-commits mailing list