summaryrefslogtreecommitdiff
path: root/docs/source/auto_examples/plot_otda_color_images.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/source/auto_examples/plot_otda_color_images.rst')
-rw-r--r--docs/source/auto_examples/plot_otda_color_images.rst79
1 files changed, 54 insertions, 25 deletions
diff --git a/docs/source/auto_examples/plot_otda_color_images.rst b/docs/source/auto_examples/plot_otda_color_images.rst
index ab0406e..a5b0d53 100644
--- a/docs/source/auto_examples/plot_otda_color_images.rst
+++ b/docs/source/auto_examples/plot_otda_color_images.rst
@@ -1,6 +1,12 @@
+.. only:: html
+
+ .. note::
+ :class: sphx-glr-download-link-note
+ Click :ref:`here <sphx_glr_download_auto_examples_plot_otda_color_images.py>` to download the full example code
+ .. rst-class:: sphx-glr-example-title
-.. _sphx_glr_auto_examples_plot_otda_color_images.py:
+ .. _sphx_glr_auto_examples_plot_otda_color_images.py:
=============================
@@ -15,8 +21,7 @@ Regularized discrete optimal transport.
SIAM Journal on Imaging Sciences, 7(3), 1853-1882.
-
-.. code-block:: python
+.. code-block:: default
# Authors: Remi Flamary <remi.flamary@unice.fr>
@@ -25,7 +30,6 @@ SIAM Journal on Imaging Sciences, 7(3), 1853-1882.
# License: MIT License
import numpy as np
- from scipy import ndimage
import matplotlib.pylab as pl
import ot
@@ -53,17 +57,17 @@ SIAM Journal on Imaging Sciences, 7(3), 1853-1882.
+
Generate data
-------------
-
-.. code-block:: python
+.. code-block:: default
# Loading images
- I1 = ndimage.imread('../data/ocean_day.jpg').astype(np.float64) / 256
- I2 = ndimage.imread('../data/ocean_sunset.jpg').astype(np.float64) / 256
+ I1 = pl.imread('../data/ocean_day.jpg').astype(np.float64) / 256
+ I2 = pl.imread('../data/ocean_sunset.jpg').astype(np.float64) / 256
X1 = im2mat(I1)
X2 = im2mat(I2)
@@ -83,12 +87,12 @@ Generate data
+
Plot original image
-------------------
-
-.. code-block:: python
+.. code-block:: default
pl.figure(1, figsize=(6.4, 3))
@@ -108,17 +112,25 @@ Plot original image
.. image:: /auto_examples/images/sphx_glr_plot_otda_color_images_001.png
- :align: center
+ :class: sphx-glr-single-img
+.. rst-class:: sphx-glr-script-out
+
+ Out:
+
+ .. code-block:: none
+
+
+ Text(0.5, 1.0, 'Image 2')
+
Scatter plot of colors
----------------------
-
-.. code-block:: python
+.. code-block:: default
pl.figure(2, figsize=(6.4, 3))
@@ -142,8 +154,9 @@ Scatter plot of colors
-.. image:: /auto_examples/images/sphx_glr_plot_otda_color_images_003.png
- :align: center
+.. image:: /auto_examples/images/sphx_glr_plot_otda_color_images_002.png
+ :class: sphx-glr-single-img
+
@@ -152,8 +165,7 @@ Instantiate the different transport algorithms and fit them
-----------------------------------------------------------
-
-.. code-block:: python
+.. code-block:: default
# EMDTransport
@@ -184,12 +196,12 @@ Instantiate the different transport algorithms and fit them
+
Plot new images
---------------
-
-.. code-block:: python
+.. code-block:: default
pl.figure(3, figsize=(8, 4))
@@ -229,28 +241,45 @@ Plot new images
-.. image:: /auto_examples/images/sphx_glr_plot_otda_color_images_005.png
- :align: center
+.. image:: /auto_examples/images/sphx_glr_plot_otda_color_images_003.png
+ :class: sphx-glr-single-img
+
+
+.. rst-class:: sphx-glr-script-out
+
+ Out:
+
+ .. code-block:: none
+
+ /home/rflamary/PYTHON/POT/examples/plot_otda_color_images.py:164: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
+ pl.show()
+
-**Total running time of the script:** ( 3 minutes 55.541 seconds)
+.. rst-class:: sphx-glr-timing
+ **Total running time of the script:** ( 2 minutes 28.821 seconds)
+
+
+.. _sphx_glr_download_auto_examples_plot_otda_color_images.py:
.. only :: html
.. container:: sphx-glr-footer
+ :class: sphx-glr-footer-example
+
- .. container:: sphx-glr-download
+ .. container:: sphx-glr-download sphx-glr-download-python
:download:`Download Python source code: plot_otda_color_images.py <plot_otda_color_images.py>`
- .. container:: sphx-glr-download
+ .. container:: sphx-glr-download sphx-glr-download-jupyter
:download:`Download Jupyter notebook: plot_otda_color_images.ipynb <plot_otda_color_images.ipynb>`
@@ -259,4 +288,4 @@ Plot new images
.. rst-class:: sphx-glr-signature
- `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_
+ `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_