DALI icon indicating copy to clipboard operation
DALI copied to clipboard

wrapPerspective support

Open adrianstaniec opened this issue 5 years ago • 4 comments

I have a question. I see that DALI currently supports warpAffine() (opencv 'inspired'), but I don't see warpPerspective equivalent GPU operation. Is/Will it be implemented?

adrianstaniec avatar Apr 13 '19 20:04 adrianstaniec

Hi @adrianstaniec

Thanks for your interest

We currently don’t have such an operator in DALI. However it can be easily implemented with the WarpAffine’s internal implementation, DisplacementFilter.

What would be the transformations you’d like to implement with it?

Kh4L avatar Apr 14 '19 20:04 Kh4L

Tracked internally as DALI-714

Kh4L avatar Apr 14 '19 23:04 Kh4L

nAt the moment, I primarily need a random keystone transform (as augmentation), so basically a symetrical 'streching out' the bottom or top edge of the image kind of into a trapezium.

e.g. this chess1

to e.g. this chess2

But having a general homography, specified by e.g. four point pairs would be even better of course.

adrianstaniec avatar Apr 15 '19 23:04 adrianstaniec

Hi,

Small update. Now you can use the remap operator that should provide the same functionality (of course you need to generate the transformation what is more complicated than using WarpPerspective directly but if it is constant you can do it once ahead of time.

JanuszL avatar Jan 24 '24 13:01 JanuszL