-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Error in keypoints when using large optical distortions #2285
Comments
I have found the origin of the issue but am sadly not able to think of a way to correct it... What I did to specifically achieve this is go into albumentations>augmentations>geomtric>functional.py>remap_keypoints
after "extensive" testing and math checking I simply decided to remove all the extras and just use the map_x and map_y for the reprojection:
Which resulted in the inverted distortion result of all the checkpoints. g.e.: When directly comparing that to the remap function that is actually applied to the image it is clear that cv2.remap must be doing something to invert the xy_map resulting in the inverting issue. |
Thanks, love such bug reports. Show deep domain knowledge of the reporter and effort he put into debug. Will look into it and fix. |
Describe the bug
When applying large deformations using opticaldistortion the keypoints are not transformed correctly.
To Reproduce
OS: Windows
Python version 3.11
Albumentations V2.0.0
Steps to reproduce the behavior:
import cv2
import numpy as np
import albumentations as A
from albumentations.core.composition import KeypointParams
import matplotlib.pyplot as plt
Expected behavior
The keypoints should be aligned with the internal checkers.
Actual behavior
The transformation between the image and the keypoints are not aligned
Screenshots
The text was updated successfully, but these errors were encountered: