Files
opencv-MIRROR/modules/video
Arghya Bose d80756a2b7 video: fix the input scaling factor of TrackerVit
The tracker normalizes the images it feeds to the network with Image2BlobParams, whose
per-channel factor has to be 1/(255*std).  It was computed as `(1.0 / stdvalue) * (1 /
255.0)`, but `double / Scalar` is Scalar's quaternion inverse, not an elementwise division,
and `Scalar / Scalar` is defined through that same inverse.  The last three elements were
therefore conjugated and the whole result divided by their sum of squares, so with the
default std = (0.229, 0.224, 0.225) the green and red planes reached the network negated and
all three were about a third of the intended magnitude.

Build the factor channel by channel in both create() overloads, and cover it with a test that
compares the response of the network the tracker feeds against an identical network fed the
documented normalization of the same template crop.
2026-10-21 09:12:52 +03:00
..
2026-06-01 14:22:51 +03:00
2025-02-20 13:58:04 +03:00