Defining projective transformations
See Projective transformations for what projective transformations are and why they are treated specially.
Transformations
The abstract type DataAugmentation.ProjectiveTransform represents a projective transformation. A ProjectiveTransform needs to implement DataAugmentation.getprojection(tfm, bounds; randstate) that should return a Transformation from CoordinateTransformations.jl.
To apply a fixed projection P that does not depend on the bounds, wrap it in Project(P).
Items
To add support for projective transformations to an item I, you need to implement
DataAugmentation.getbounds(item::I)returns the spatial bounds of the item; andDataAugmentation.project(P, item::I, indices)applies the projective transformationPand crops toindices
To support apply!-ing projective transformations, DataAugmentation.project!(bufitem, P, item, indices) can also be implemented.