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

Perspective Transformations #393

Open
MentalGear opened this issue Aug 23, 2019 · 6 comments
Open

Perspective Transformations #393

MentalGear opened this issue Aug 23, 2019 · 6 comments

Comments

@MentalGear
Copy link

Perspectie transformations seems to be available, but not listed at https://imgaug.readthedocs.io/en/latest/source/augmenters.html

@aleju
Copy link
Owner

aleju commented Aug 24, 2019

Yes, that overview page is very out of date and misses like half of all augmenters...
There will be an updated one upon release of the next version of the library. It is just not merged yet, because the next version also contains some breaking changes.

@marz233
Copy link

marz233 commented Sep 26, 2019

When I using Perspective Transformation there is some problem:
The polygon after perspective transformation should stay in the image boundary,not like the image show below
Screenshot from 2019-09-26 19-06-11
Is it a bug exist?
Maybe clipping algorithm like Sutherland-Hodgman or Weiler-Atherton can solve this problem? :P

@marz233
Copy link

marz233 commented Sep 26, 2019

emm... I got clip_out_of_image() to solve the problem above
psoi_aug=psoi_aug.clip_out_of_image()

@marz233
Copy link

marz233 commented Sep 27, 2019

I found clip_out_of_image() can only clip one polygon to another one,the problem is concave polygon after clip might divide into more than one polygon:P
How should I deal with this?

@aleju
Copy link
Owner

aleju commented Sep 27, 2019

Polygon.clip_out_of_image() returns a list of 0..N polygons, i.e. one input polygon can become multiple polygons after clipping. Isn't that what you want?

@lamhoangtung
Copy link

When I using Perspective Transformation there is some problem:
The polygon after perspective transformation should stay in the image boundary,not like the image show below
Screenshot from 2019-09-26 19-06-11
Is it a bug exist?
Maybe clipping algorithm like Sutherland-Hodgman or Weiler-Atherton can solve this problem? :P

Check out this PR #452, it's already merged into master. So you just need to:

pip install git+https://github.com/aleju/imgaug

and do this:

iaa.PerspectiveTransform(scale=(0.075, 0.1), fit_output=True, mode='constant', cval=0)

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

4 participants