[python-dtcwt] 268/497: examples/image-registration: save figures and include in docs

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Jul 21 18:06:13 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 5cd85005db46161f4923714f00014be3729117a7
Author: Rich Wareham <rjw57 at cam.ac.uk>
Date:   Thu Jan 30 11:53:20 2014 +0000

    examples/image-registration: save figures and include in docs
---
 docs/examples.rst              |   7 +++++--
 docs/tennis-registration.png   | Bin 0 -> 854860 bytes
 docs/traffic-registration.png  | Bin 0 -> 756385 bytes
 examples/image-registration.py |   5 ++++-
 4 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/docs/examples.rst b/docs/examples.rst
index 8d444c2..1054f58 100644
--- a/docs/examples.rst
+++ b/docs/examples.rst
@@ -40,6 +40,9 @@ traffic at a road junction.
 
 .. _Efficient Registration of Nonrigid 3-D Bodies: http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=5936113
 
-The source for the script is shown here:
+It will attempt to register two image pairs: a challenging sequence from a
+video sequence and a sequence from a traffic camera. The result is shown below.
 
-.. literalinclude:: ../examples/image-registration.py
+.. image:: tennis-registration.png
+
+.. image:: traffic-registration.png
diff --git a/docs/tennis-registration.png b/docs/tennis-registration.png
new file mode 100644
index 0000000..c39dafd
Binary files /dev/null and b/docs/tennis-registration.png differ
diff --git a/docs/traffic-registration.png b/docs/traffic-registration.png
new file mode 100644
index 0000000..5603746
Binary files /dev/null and b/docs/traffic-registration.png differ
diff --git a/examples/image-registration.py b/examples/image-registration.py
index 42d9d45..90098ea 100755
--- a/examples/image-registration.py
+++ b/examples/image-registration.py
@@ -51,7 +51,8 @@ def register_frames(filename):
     vxs -= np.median(vxs.flat)
     vys -= np.median(vys.flat)
 
-    figure()
+    figure(figsize=(16,9))
+
     subplot(221)
     imshow(np.dstack((f1, f2, np.zeros_like(f1))))
     title('Overlaid frames')
@@ -72,6 +73,8 @@ def register_frames(filename):
     colorbar()
     title('Magnitude of computed velocity (median subtracted)')
 
+    savefig(os.path.splitext(os.path.basename(filename))[0] + '-registration.png')
+
 register_frames(os.path.join(os.path.dirname(__file__), '..', 'tests', 'traffic.npz'))
 register_frames(os.path.join(os.path.dirname(__file__), '..', 'tests', 'tennis.npz'))
 

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