Fix for uninitialized covariance matrix
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 14 Aug 2013 05:30:35 +0000 (05:30 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 14 Aug 2013 05:30:35 +0000 (05:30 +0000)
This is likely a culptrit caused #36231: Motion tracker bug in 2.68

extern/libmv/libmv/tracking/track_region.cc

index 6e9fb95654d34e5ef2d1df9c1a591855de04dd55..349d84b381764802202c851a870e0aee0ac4133f 100644 (file)
@@ -796,7 +796,7 @@ struct TranslationRotationWarp {
     parameters[1] = t[1];
 
     // Obtain the rotation via orthorgonal procrustes.
-    Mat2 correlation_matrix;
+    Mat2 correlation_matrix = Mat2::Zero();
     for (int i = 0; i < 4; ++i) {
       correlation_matrix += q1.CornerRelativeToCentroid(i) *
                             q2.CornerRelativeToCentroid(i).transpose();
@@ -864,7 +864,7 @@ struct TranslationRotationScaleWarp {
     parameters[2] = 1.0 - q2.Scale() / q1.Scale();
 
     // Obtain the rotation via orthorgonal procrustes.
-    Mat2 correlation_matrix;
+    Mat2 correlation_matrix = Mat2::Zero();
     for (int i = 0; i < 4; ++i) {
       correlation_matrix += q1.CornerRelativeToCentroid(i) *
                             q2.CornerRelativeToCentroid(i).transpose();