Skip to content

Affine transformation with warp mode doesn't "roll" keypoints #843

@DanielKarasek

Description

@DanielKarasek

Keypoints should roll across the borders together with the image, but instead it just goes out of the image boundaries.
Minimal example where keypoints get out of boundaries of the image, while they should warp around:

import imgaug.augmenters as iaa
import imgaug as ia

# Define the keypoints
keypoints_on_images = [ia.KeypointsOnImage([
    ia.Keypoint(x=80, y=60)], 
    shape=(100, 100, 3))]

# Define the augmenter
aug = iaa.Affine(translate_px={"x": 40}, mode="wrap")

# Apply the augmentation
images_aug, keypoints_aug = aug(images=[image], keypoints=keypoints_on_images)

print(keypoints_aug)
>>> '[KeypointsOnImage([Keypoint(x=130.00000000, y=60.00000000)], shape=(100, 100, 3))]'
# keypoint is out of the image boundaries, it should be at x:30, y:60 instead

Same problem appears for all CBAs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions