[Bf-blender-cvs] [92f6e60f46b] master: Fix T67876: 2D Stabilization doesn't compensate rotation in spacial cases

Sergey Sharybin noreply at git.blender.org
Mon Jul 29 12:30:49 CEST 2019


Commit: 92f6e60f46b4f4db04a3b9a49b9429a027148ee7
Author: Sergey Sharybin
Date:   Mon Jul 29 12:26:47 2019 +0200
Branches: master
https://developer.blender.org/rB92f6e60f46b4f4db04a3b9a49b9429a027148ee7

Fix T67876: 2D Stabilization doesn't compensate rotation in spacial cases

This was caused by 2D stabilization trying to be smart and lower weight
of tracks which are too close to the rotation center. This was causing
algorithm to ignore a single track which was set to constant 1 weight and
used for rotation compensation.

It is quite tricky to quantify this change without having comprehensive
regression suit, so can only hope that initial intention is still working
as expected.

===================================================================

M	source/blender/blenkernel/intern/tracking_stabilize.c

===================================================================

diff --git a/source/blender/blenkernel/intern/tracking_stabilize.c b/source/blender/blenkernel/intern/tracking_stabilize.c
index b852e8a12cd..fa2399dd989 100644
--- a/source/blender/blenkernel/intern/tracking_stabilize.c
+++ b/source/blender/blenkernel/intern/tracking_stabilize.c
@@ -611,16 +611,19 @@ static bool average_track_contributions(StabContext *ctx,
         float rotation, scale, quality;
         quality = rotation_contribution(
             stabilization_base, marker, aspect, r_pivot, &rotation, &scale);
-        weight *= quality;
-        weight_sum += weight;
-        *r_angle += rotation * weight;
+        const float quality_weight = weight * quality;
+        weight_sum += quality_weight;
+        *r_angle += rotation * quality_weight;
         if (stab->flag & TRACKING_STABILIZE_SCALE) {
-          *r_scale_step += logf(scale) * weight;
+          *r_scale_step += logf(scale) * quality_weight;
         }
         else {
           *r_scale_step = 0;
         }
-        ok |= (weight_sum > EPSILON_WEIGHT);
+        /* NOTE: Use original marker weight and not the scaled one with the proximity here to allow
+         * simple stabilization setups when there is a single track in a close proximity of the
+         * center. */
+        ok |= (weight > EPSILON_WEIGHT);
       }
     }
   }



More information about the Bf-blender-cvs mailing list