gvtulder / elasticdeform

Differentiable elastic deformations for N-dimensional images (Python, SciPy, NumPy, TensorFlow, PyTorch).
Other
186 stars 25 forks source link

rendering self-overlapped deformed grid #13

Open fyviezhao opened 3 years ago

fyviezhao commented 3 years ago

Thanks for this awesome repo! I thought in your implementation the pixel color of the output (deformed) image is sampled from the source image by a warped grid via interpolation like torch.grid_sample(src_im, warped_grid), where the warped grid is obtained by deforming a "standard" grid with the given displacement, right? This approach works fine when the warped grid is non-self-overlapping, while I found that in the case of a self-overlapped warped grid obtained by, say, skinning the regular grid (please see figure below), the aforementioned rendering method seems to lose efficacy. Could you please help figure out how to use interpolation-based differentiable rendering to plot the deformed self-overlapped grid? image