kevinzakka / spatial-transformer-network

A Tensorflow implementation of Spatial Transformer Networks.
MIT License
985 stars 268 forks source link

Cliping issue #16

Closed Vaalizaadeh closed 6 years ago

Vaalizaadeh commented 6 years ago

Hey, man! Thanks for your implementation. I guess there is something that has to be noticed. Don't you think you have to clip the x in your bilinear function, too?

kevinzakka commented 6 years ago

@Vaalizaadeh I don't think it matters because I end up clipping the 4 corner coordinates before sampling. So suppose a certain coordinate lies outside the image range.

So no difference.

Vaalizaadeh commented 6 years ago

@kevinzakka I guess if you don't clip, the intensity of boundary locations will have wrong calculations. Take a look at the weights of the interpolation line. suppose one x which is not clipped has a value equal to $255.5$ and the range is $255$. it may lead to wrong answers if the other coordinate lies in the plane.