[python-dtcwt] 240/497: registration: tune selection of levels slightly

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Jul 21 18:06:10 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 ec4599953859718571226d3f62b3aa5b1acde7f3
Author: Rich Wareham <rjw57 at cam.ac.uk>
Date:   Mon Jan 27 15:58:00 2014 +0000

    registration: tune selection of levels slightly
    
    Use one iteration for computing global transform and then never use
    above level index 2 (== level 3) for computing registration.
---
 dtcwt/registration.py | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/dtcwt/registration.py b/dtcwt/registration.py
index e2ca100..2469853 100644
--- a/dtcwt/registration.py
+++ b/dtcwt/registration.py
@@ -263,22 +263,21 @@ def estimateflow(reference_h, target_h):
     avecs = np.zeros((warped_h[2].shape[0], warped_h[2].shape[1], 6))
 
     # Compute initial global transform
-    for it in xrange(2):
-        levels = list(x for x in xrange(len(warped_h)-1, len(warped_h)-3, -1) if x>=0)
-        Qt_mats = list(x.sum() for x in qtildematrices(warped_h, target_h, levels))
-        Qt = np.sum(Qt_mats, axis=0)
+    levels = list(x for x in xrange(len(warped_h)-1, len(warped_h)-3, -1) if x>=0)
+    Qt_mats = list(x.sum() for x in qtildematrices(warped_h, target_h, levels))
+    Qt = np.sum(Qt_mats, axis=0)
 
-        a = solvetransform(Qt)
-        for r, c in itertools.product(xrange(avecs.shape[0]), xrange(avecs.shape[1])):
-            avecs[r,c] += a
+    a = solvetransform(Qt)
+    for r, c in itertools.product(xrange(avecs.shape[0]), xrange(avecs.shape[1])):
+        avecs[r,c] += a
 
-        for l in levels:
-            warped_h[l] = warphighpass(reference_h[l], avecs, method='bilinear')
+    for l in levels:
+        warped_h[l] = warphighpass(reference_h[l], avecs, method='bilinear')
 
     # Refine estimate
-    for it in xrange(2 * (len(warped_h)-3)):
+    for it in xrange(2 * (len(warped_h)-3) - 1):
         s, e = len(warped_h) - 2, len(warped_h) - 2 - (it+1)//2
-        levels = list(x for x in xrange(s, e-1, -1) if x>=1 and x<len(warped_h))
+        levels = list(x for x in xrange(s, e-1, -1) if x>=2 and x<len(warped_h))
         if len(levels) == 0:
             continue
 

-- 
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