-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Augmentation by Perspective Transform #56
Comments
If there's an OpenCV/skimage function that works with z- and y-angles (or something close to that) it shouldn't be too hard to implement and seems kinda useful. |
@aleju ok, good! I'll try to find some time to implement this. Will keep you posted. |
For the info: implementation of the proposed method in Augmentor - https://github.com/mdbloice/Augmentor/blob/master/Augmentor/Operations.py#L230 |
Yeah, there's now a perspective transform in the library, which is based on a four-point transformation. Currently, the four source points are randomly located and the four target points are just the corners of the image plane. Maybe in the future I change that so that the target points are also randomly sampled, which then might randomly sometimes perform the same augmentation as the perspective transform with vertical and horizontal angle. For some applications vertical+horizontal angle might still be more useful, so at some point it will probably be added too. |
Is it possible to drop the restriction "PerspectiveTransform is currently limited to images with 4 or less channels."? It seems cv2.warpPerspective can support multiple channels. |
Last time I tried images with more than 4 channels, OpenCV generated an error that seemed like the input was expected to a max of 4 channels. |
A more straightforward option is to remove the assertion on L992 from the code. Would it be possible to include this change in a future release? |
I just pushed a change that allows to use any number of channels in PerspectiveTransform. Just deleting the assert was not enough, because then |
Perfect, thank you @aleju! |
Have you guys considered adding a |
@JaviFuentes94 I have same feature request today and made a pull request, you may try this and see if it fits you. #452 |
Hi!
I think the case of augmentation by perspective transform is very useful for real-life applications. Would you be interested in such function?
See http://www.euclideanspace.com/maths/discrete/groups/categorise/finite/cube/rotFace.png . Let the plane with a green
1
be an image. I'd suggest to parametrize the augmentation by angles aroundz
andy
, i.e.img_aug = aug_by_perspective(img, angle_vert, angle_horiz)
.Implementing this should be relatively simple using OpenCV.
The text was updated successfully, but these errors were encountered: