Skip to content

Commit c53cdfd

Browse files
committed
Merge pull request #2728 from alalek:fix_uninitialized_var
2 parents a960877 + 2159102 commit c53cdfd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

modules/optflow/src/rlof/berlof_invoker.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ class TrackerInvoker : public cv::ParallelLoopBody
187187
cv::Size _winSize = winSize;
188188
float MEstimatorScale = 1;
189189
int buffIdx = 0;
190-
float c[8];
191190
cv::Mat GMc0, GMc1, GMc2, GMc3;
192191
cv::Vec2f Mc0, Mc1, Mc2, Mc3;
193192
int noIteration = 0;
@@ -572,6 +571,7 @@ class TrackerInvoker : public cv::ParallelLoopBody
572571
Mc3[0] = _b0[3];
573572
Mc3[1] = _b1[3];
574573

574+
float c[8] = {};
575575
c[0] = -Mc0[0];
576576
c[1] = -Mc1[0];
577577
c[2] = -Mc2[0];
@@ -830,7 +830,6 @@ class TrackerInvoker : public cv::ParallelLoopBody
830830
int j;
831831
float MEstimatorScale = 1;
832832
int buffIdx = 0;
833-
float c[8];
834833
cv::Mat GMc0, GMc1, GMc2, GMc3;
835834
cv::Vec4f Mc0, Mc1, Mc2, Mc3;
836835
int noIteration = 0;
@@ -1355,6 +1354,7 @@ class TrackerInvoker : public cv::ParallelLoopBody
13551354
Mc3[3] = -_b3[3];
13561355

13571356
//
1357+
float c[8] = {};
13581358
c[0] = -Mc0[0];
13591359
c[1] = -Mc1[0];
13601360
c[2] = -Mc2[0];
@@ -1620,7 +1620,6 @@ class TrackerInvoker : public cv::ParallelLoopBody
16201620
nextPt += halfWin;
16211621
Point2f prevDelta(0,0);
16221622

1623-
float c[8];
16241623
for( j = 0; j < criteria.maxCount; j++ )
16251624
{
16261625
cv::Point2f delta;
@@ -1629,6 +1628,7 @@ class TrackerInvoker : public cv::ParallelLoopBody
16291628
b = nextPt.y - cvFloor(nextPt.y);
16301629
float ab = a * b;
16311630

1631+
float c[8] = {};
16321632

16331633
if( (inextPt.x != cvFloor(nextPt.x) || inextPt.y != cvFloor(nextPt.y) || j == 0))
16341634
{
@@ -1996,7 +1996,6 @@ namespace radial {
19961996
cv::Point2f backUpGain = gainVec;
19971997
cv::Size _winSize = winSize;
19981998
int j;
1999-
float c[8];
20001999
cv::Mat GMc0, GMc1, GMc2, GMc3;
20012000
cv::Vec4f Mc0, Mc1, Mc2, Mc3;
20022001
int noIteration = 0;
@@ -2359,6 +2358,7 @@ namespace radial {
23592358
Mc3[3] = -_b3[3];
23602359

23612360
//
2361+
float c[8] = {};
23622362
c[0] = -Mc0[0];
23632363
c[1] = -Mc1[0];
23642364
c[2] = -Mc2[0];

0 commit comments

Comments
 (0)