summaryrefslogtreecommitdiff
path: root/examples/plot_otda_color_images.py
diff options
context:
space:
mode:
authorRémi Flamary <remi.flamary@gmail.com>2018-11-19 11:18:37 +0100
committerRémi Flamary <remi.flamary@gmail.com>2018-11-19 11:18:37 +0100
commit90d04e0f9a3e70d76c9a42b9bbc9c6f6a168269c (patch)
tree375231ac12e6692c0d50be2f322f94fd73c05a8d /examples/plot_otda_color_images.py
parentde04afc0f9f01fc09a3a8138865eacc0b6f4415d (diff)
parentc48be436f984eba910b838c1586a208e3fe3d91f (diff)
Merge branch 'master' of github.com:rflamary/POT
Diffstat (limited to 'examples/plot_otda_color_images.py')
-rw-r--r--examples/plot_otda_color_images.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/plot_otda_color_images.py b/examples/plot_otda_color_images.py
index e77aec0..62383a2 100644
--- a/examples/plot_otda_color_images.py
+++ b/examples/plot_otda_color_images.py
@@ -4,7 +4,7 @@
OT for image color adaptation
=============================
-This example presents a way of transferring colors between two image
+This example presents a way of transferring colors between two images
with Optimal Transport as introduced in [6]
[6] Ferradans, S., Papadakis, N., Peyre, G., & Aujol, J. F. (2014).
@@ -27,7 +27,7 @@ r = np.random.RandomState(42)
def im2mat(I):
- """Converts and image to matrix (one pixel per line)"""
+ """Converts an image to matrix (one pixel per line)"""
return I.reshape((I.shape[0] * I.shape[1], I.shape[2]))
@@ -115,8 +115,8 @@ ot_sinkhorn.fit(Xs=Xs, Xt=Xt)
transp_Xs_emd = ot_emd.transform(Xs=X1)
transp_Xt_emd = ot_emd.inverse_transform(Xt=X2)
-transp_Xs_sinkhorn = ot_emd.transform(Xs=X1)
-transp_Xt_sinkhorn = ot_emd.inverse_transform(Xt=X2)
+transp_Xs_sinkhorn = ot_sinkhorn.transform(Xs=X1)
+transp_Xt_sinkhorn = ot_sinkhorn.inverse_transform(Xt=X2)
I1t = minmax(mat2im(transp_Xs_emd, I1.shape))
I2t = minmax(mat2im(transp_Xt_emd, I2.shape))