Barycentric Coordinates 2D Interpolation Problem
![](https://secure.gravatar.com/avatar/9ff2960610214ccc82bb4dd78400a420.jpg?s=120&d=mm&r=g)
Hi, I am currently trying to use the bregman barycenter algorithm to interpolate between 2D floating point arrays. I am getting some odds results and was hoping to better understand what's happening. The example I've attached illustrates the main issue. In this example, I'm trying to interpolate between two 2D arrays, one with 1s in the upper-right quadrant, and 0s elsewhere, the other with 1s in the lower left quadrant, and 0s elsewhere. I'm then using barycenter with different weights ([1-t, t] for t in {0, 0.25, 0.5, 0.75, 1}). What I would have expected is that each output would have the same number of 1s, just in different locations. for t = 0, I'd expect to get my first input, for t = 1, my second input. For t=0.5, one quadrant's-worth of 1s at the center of the output image. Instead, the output I'm getting is fuzzy, and also significantly offset from where I'd expect for all t other than 0.5. At the very least, I can't imaging why I would get anything other than my original input for t = 0 or 1. Do I misunderstand the function, or have I made an error somewhere? If anyone could help me to better understand what's happening here, I would appreciate it. Here the code I'm using: https://pastebin.com/EuW2sAUM And here's the output of the above code: https://imgur.com/a/H9AK9
![](https://secure.gravatar.com/avatar/a5a4c06c08c09c1879f2d785bc311ad7.jpg?s=120&d=mm&r=g)
Hello, What you see is normal because the current barycenter implemented in POT (a new one is coming) is using entropic regularized OT as discussed in the paper below: https://arxiv.org/pdf/1412.5154.pdf If you look into Figure 2 you will see that they also get a smoothing except in the corners where i believe they did not use the algorithm but return directly the original image. Regularization has this unfortunate effect of smoothing the barycenter but allows for quicker resolution of the problem. The barycenter examples in the notebook is not very honest here because since we use Gaussian everything is already smooth but the same effect applies Also note that if you want to perform barycenter in 2D images as in you example you should look at: https://people.csail.mit.edu/jsolomon/assets/convolutional_w2.compressed.pdf that also does regularization but which can be very quick on 2D/3D images. It has not been implemented in POT yet but it's also in the work. Rémi Le 29/03/2018 à 23:05, Aruther5@gmu.edu a écrit :
Hi, I am currently trying to use the bregman barycenter algorithm to interpolate between 2D floating point arrays. I am getting some odds results and was hoping to better understand what's happening. The example I've attached illustrates the main issue. In this example, I'm trying to interpolate between two 2D arrays, one with 1s in the upper-right quadrant, and 0s elsewhere, the other with 1s in the lower left quadrant, and 0s elsewhere. I'm then using barycenter with different weights ([1-t, t] for t in {0, 0.25, 0.5, 0.75, 1}). What I would have expected is that each output would have the same number of 1s, just in different locations. for t = 0, I'd expect to get my first input, for t = 1, my second input. For t=0.5, one quadrant's-worth of 1s at the center of the output image. Instead, the output I'm getting is fuzzy, and also significantly offset from where I'd expect for all t other than 0.5. At the very least, I can't imaging why I would get anything other than my original in put for t = 0 or 1. Do I misunderstand the function, or have I made an error somewhere? If anyone could help me to better understand what's happening here, I would appreciate it.
Here the code I'm using: https://pastebin.com/EuW2sAUM And here's the output of the above code: https://imgur.com/a/H9AK9 _______________________________________________ POT mailing list pot@python.org https://mail.python.org/mm3/mailman3/lists/pot.python.org/
-- Rémi Flamary Web: http://remi.flamary.com Tel: +33 (0)4 92 07 63 80 Laboratoire Lagrange, UMR CNRS 7293 Observatoire de la Côte d'Azur Université de Nice Sophia-Antipolis
![](https://secure.gravatar.com/avatar/51baa1cea64d525512c6380a28d652bb.jpg?s=120&d=mm&r=g)
Hi. In the first line you mention that there is a new implementation of barycenter coming in POT .What paper would that be based on and when might you release that?
participants (3)
-
Aruther5@gmu.edu
-
Kowshik Thopalli
-
Rémi Flamary