Open hellozgm opened 6 years ago
No, that's currently not possible. I think the waiting pull request would have added something in that direction to scikit-image's affine warping function, which then could have been added to Affine, but so far it was not merged to scikit-image. So the only way here to do this is to manually compute scalings that don't remove image content given sampled rotation and shearing values. But would require a partial rewrite of Affine, as scale, rotation and shear are sampled independently from each other.
For PerspectiveTransform it would be even harder as that augmenter currently samples a subpolygon within the image and "zooms into" that, thereby removing anything outside of the polygon.
OK, I would try your suggestion, thanks for your reply.
Many image augmentation method such as Affine rotation and PerspectiveTransform may generate the cutting augmented result. Here is an example, after I rotate the lenna image by 45 degree, the default Affine method generate the cutting edge result:
But I want the rotation keep all augmented image edges, like this:
So, are there any way to do so? Many thanks!