DALI
DALI copied to clipboard
Generic Warp operation support
Somehow similarly to #776 I would be interested in exploiting warps beyond affine ones. In particular elastic deformation would be of interest to me. I saw that the repo contains a DisplacementFilter operator which seems generic but it doesn't seem to be exposed in python.
Hi,
We plan to implement elastic deformation as it is quite a popular transformation in the medical domain, but I cannot commit to any particular date. Still, we would be more than happy to accept any contribution adding such functionality.
Regarding DisplacementFilter although it is flexible internally, it is not easy to expose all of its functionality to the outside. Also, it has some design defects and that is why we are slowly moving to another approach and we don't have any plan to develop DisplacementFilter anymore.
@mzient have I missed anything?
WarpPerspective, ElasticTransform and generic warp/remap are related, but qualitatively different. Don't look at DisplacementFilter is a remnant of the old way of doing things - we only use it in some little used operators, whereas the two major ones (WarpAffine and Rotate) use a new approach.
We can expose a generic remap which accepts an image and a coordinate map (source sample coordinates for each output pixel) or coordinate offsets, but it needs to be properly planned - it's certainly not a feature we'll have tomorrow.
Looking forward to a opencv-like remap function in DALI. It is a very common augmentation operation nowadays. ❤️