crossnet icon indicating copy to clipboard operation
crossnet copied to clipboard

Effect of wa,wb,wc,wd in interpolate function ?

Open Sinnaeve opened this issue 5 years ago • 0 comments

Hi,

I'm not sure to understand the use of wa, wb, wc, wd in the interpolate function: "

use indices to lookup pixels in the flat image and restore

# channels dim
im_flat = tf.reshape(im, tf.stack([-1, channels]))
im_flat = tf.cast(im_flat, 'float32')
Ia = tf.gather(im_flat, idx_a)
Ib = tf.gather(im_flat, idx_b)
Ic = tf.gather(im_flat, idx_c)
Id = tf.gather(im_flat, idx_d)

wa = tf.expand_dims(((1-x+x0_f) * (1-y+y0_f)), 1)
wb = tf.expand_dims(((1-x+x0_f) * (1-y1_f+y)), 1)
wc = tf.expand_dims(((1-x1_f+x) * (1-y+y0_f)), 1)
wd = tf.expand_dims(((1-x1_f+x) * (1-y1_f+y)), 1)

output = tf.add_n([waIa, wbIb, wcIc, wdId]) "

Do you use the w as a weight which value depends on how far the sample pixel is from the true floating interpolated localization (x,y) ?

Sinnaeve avatar May 27 '19 15:05 Sinnaeve