[python-dtcwt] 454/497: registration: fix selection of levels
Ghislain Vaillant
ghisvail-guest at moszumanska.debian.org
Tue Jul 21 18:06:37 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 69e4c0eb59b35f426b065cff7b80a2a4d4a22db9
Author: Rich Wareham <rjw57 at cam.ac.uk>
Date: Mon Jun 30 14:53:03 2014 +0100
registration: fix selection of levels
now that the confidence parameter has been added, we can get good
results using a different subset of levels
---
dtcwt/registration.py | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/dtcwt/registration.py b/dtcwt/registration.py
index bd4bb27..9deccc9 100644
--- a/dtcwt/registration.py
+++ b/dtcwt/registration.py
@@ -319,7 +319,7 @@ def estimatereg(source, reference, regshape=None):
this function into a velocity field.
"""
- # Extract number of levels and shape of level 3 subband
+ # Extract number of levels and shape of level 4 (i.e. index 3) subband
nlevels = len(source.highpasses)
if regshape is None:
avecs_shape = source.highpasses[3].shape[:2] + (6,)
@@ -342,10 +342,9 @@ def estimatereg(source, reference, regshape=None):
avecs[:,:,idx] = a[idx]
# Refine estimate
- for it in xrange(2 * (nlevels-3) - 1):
- s, e = nlevels, nlevels - 2 - (it+1)//2
- levels = list(x for x in xrange(s, e-1, -1) if x>=2 and x<nlevels)
- if len(levels) == 0:
+ for s in np.arange(nlevels-1, 0, -0.5):
+ levels = list(int(np.floor(s))-x for x in range(2) if s-x >= 2)
+ if len(levels) < 2:
continue
# Warp the levels we'll be looking at with the current best-guess transform
--
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