mirror of
https://github.com/opencv/opencv.git
synced 2026-11-16 06:17:53 -06:00
LightGlueMatcher normalizes each axis by its own image dimension, while the LightGlue reference (cvg/LightGlue normalize_keypoints, kornia) shifts by half the image size and divides both axes by half the longer side. The two only agree for square images, so models exported from the reference forward without normalization (e.g. XFeat's LighterGlue) see a stretched geometry on non-square images. Add LightGlueNormalization with LG_NORM_MODEL (default, unchanged per-axis mapping of the LightGlueType) and LG_NORM_MAX_SIDE (reference mapping), selected with setKeypointNormalization() independently of the model type and kept by clone(). Keypoints passed with an empty image size are still used as given. Fixes #30556