-
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
Keypoints relocate wrongly when rotated #496
Comments
My current hack is to do something like this: img = "some small image"
img, koi = iaa.Affine(rotate=180)(image=img, keypoints=koi.on((10000,10000)))
koi = koi.on(img) This will make the off-by-one error insignificant. |
Can you try the latest version from master and see if it works then as expected? This is the output that I got with master:
Thanks for the detailed bug report though! |
OK Nice.! |
OK. I figured it out now. I just have to use It seems the new code is working good. So here's the last question: By the way, your library is awesome it helps my project a lot. So thank you! |
I hope that the next release will happen in two weeks or so. Not entirely sure yet. |
OK. I think my issue is solved. I can just use the latest version from master. |
I observed that when I use
iaa.Affine(rotate="anything that is not zero")
, the keypoints shifted wrongly on the small image.In the following image, the 3rd plot is rotated by 180 degrees, but somehow the keypoints are not in the center of the circle. The problem is more noticeable when you resize the image further to 30x30.
Here's the minimal code to reproduce the issue:
I don't know if this is a bug or it's simply my mistake of how I'm using the library. Please give me insight. @aleju
But I think it's kind of an off-by-one error. I see that the first coordinate (100,100) gets mapped to (9,9) on 45x45 image, which is correct, but after rotation, the coordinate gets mapped to (35,35) which should be (36,36) if I understand correctly.
Here's the output of the program:
If this is the case, it means that you won't notice this bug in a big image because one pixel wrong is not visible to the naked eyes
The text was updated successfully, but these errors were encountered: