[python-dtcwt] 455/497: make image registration example a little prettier
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 c68aaa98937117c2e5364468295a0d02a62a2161
Author: Rich Wareham <rjw57 at cam.ac.uk>
Date: Mon Jun 30 14:53:36 2014 +0100
make image registration example a little prettier
---
docs/image-registration.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/docs/image-registration.py b/docs/image-registration.py
index f5f5801..790a923 100755
--- a/docs/image-registration.py
+++ b/docs/image-registration.py
@@ -44,9 +44,9 @@ def register_frames(filename):
warped_f1 = warp(f1, avecs, method='bilinear')
logging.info('Computing velocity field')
- step = 8
+ step = 16
X, Y = np.meshgrid(np.arange(f1.shape[1]), np.arange(f1.shape[0]))
- vxs, vys = velocityfield(avecs, f1.shape, method='bilinear')
+ vxs, vys = velocityfield(avecs, f1.shape, method='nearest')
vxs -= np.median(vxs.flat)
vys -= np.median(vys.flat)
@@ -62,11 +62,12 @@ def register_frames(filename):
title('Frame 1 warped to Frame 2 (image domain)')
subplot(223)
+ sc = 2
imshow(np.dstack((f1, f2, np.zeros_like(f2))))
quiver(X[::step,::step], Y[::step,::step],
- -vxs[::step,::step]*f1.shape[1], -vys[::step,::step]*f1.shape[0],
+ -sc*vxs[::step,::step]*f1.shape[1], -sc*vys[::step,::step]*f1.shape[0],
color='b', angles='xy', scale_units='xy', scale=1)
- title('Computed velocity field (median subtracted)')
+ title('Computed velocity field (median subtracted), x{0}'.format(sc))
subplot(224)
imshow(np.sqrt(vxs*vxs + vys*vys), interpolation='none', cmap=cm.hot)
--
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