An image in grayscale I is presented as a 2D tensor (size W, H) and coordinate tensor C (Dim. None, 2). I want to interpret the C lines as coordinates in I , the sample I in these coordinates, using some interpolation (bilinear will probably be good for my use case) and save the received values ββin a new Tensor P (dimension None, i.e. 1-dimensional with as many entries as C has lines).
Is this possible (effective) with TensorFlow? All I can find are functions for resizing (equidistant oversampling, if you like) images. But I canβt find anything out of the box to select from the coordinate list.
those. I would expect to find something like the tf.interpolate () function:
I = tf.placeholder("float", shape=[128, 128]) C = tf.placeholder("float", shape=[None, 2]) P = tf.interpolate(I, C, axis=[0, 1], method="linear")
Ideally, I would look for a solution that would allow me to interpolate I in the N dimensional tensor I along dimensions M using C with the shape (None, M) and produce the output signal NM + 1, as indicated by the "axis" parameter in the above code.
(The "image" in my application is not a btw. Picture, it displays data from a physical model (when used as a placeholder) or an alternative model studied (when used as a variable). Now this physical model is 2 degrees of freedom, thus interpolating into " image "is enough for now, but I could take a look at higher dimensional models in the future.)
In case something like this is impossible with existing TensorFlow functions: where do I start when I would like to implement something like this tf.interpolate () operator? (documentation and / or simple code example)