Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not cropping skewed image to original image size #241

Open
NithyaMogane-TomTom opened this issue Dec 5, 2021 · 1 comment
Open

Not cropping skewed image to original image size #241

NithyaMogane-TomTom opened this issue Dec 5, 2021 · 1 comment

Comments

@NithyaMogane-TomTom
Copy link

Description:
When one uses skew_left_right(), the image is cropped to fit original image size and hence, content is lost.
For example:
Original:
image
After skewing:
image
As you can see the content is clipped at top-right and bottom-right corners.

How can I skew in a fashion that preserves content at the expense of larger (or changed) image sizes ?

Language/Compiler:
Python 3.7

OS:
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic

Version:
0.2.9

How to recreate:
Sample input image -
image

import Augmentor

p = Augmentor.Pipeline("<image-location>")
p.skew_left_right(probability=1.0, magnitude=0.5)
p.sample(3)

What i have already done to resolve the issue:
peruse documentation - https://augmentor.readthedocs.io/en/master/userguide/mainfeatures.html
and code on github -

def skew_left_right(self, probability, magnitude=1):

@mdbloice
Copy link
Owner

mdbloice commented Dec 7, 2021

Hi there @NithyaMogane-TomTom

Actually, this is not supported. The skew operations maintain the image size, as different skew magnitudes/angles would result in many different image sizes due to the stochastic nature of the pipeline. By default Augmentor tries to maintain consistently sized images and automatically performs the cropping required to maintain this.
I hope this helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants