Skip to content

Commit d1059b4

Browse files
committed
Fix opencv#5
1 parent c15d98b commit d1059b4

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

modules/datasets/src/track_alov.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ namespace cv
167167
//Make a list of datasets lengths
168168
int currFrameID = 0;
169169

170-
do
170+
for (;;)
171171
{
172172
currFrameID++;
173173
string fullPath = fullFramePath(rootPath, i, k, currFrameID);
@@ -187,7 +187,7 @@ namespace cv
187187
//Add object to storage
188188
objects.push_back(currObj);
189189

190-
} while (1);
190+
}
191191

192192
datasetsLengths.push_back(currFrameID - 1);
193193
data.push_back(objects);
@@ -214,7 +214,8 @@ namespace cv
214214
}
215215

216216
//Ground Truth data
217-
double n = 0, x1 = 0, y1 = 0,
217+
int n = 0;
218+
double x1 = 0, y1 = 0,
218219
x2 = 0, y2 = 0,
219220
x3 = 0, y3 = 0,
220221
x4 = 0, y4 = 0;
@@ -278,7 +279,8 @@ namespace cv
278279
framesNum++;
279280

280281
//Ground Truth data
281-
double n = 0, x1 = 0, y1 = 0,
282+
int n = 0;
283+
double x1 = 0, y1 = 0,
282284
x2 = 0, y2 = 0,
283285
x3 = 0, y3 = 0,
284286
x4 = 0, y4 = 0;

modules/tracking/src/gtrUtils.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ namespace cv
8181
//Crop Target Patch
8282

8383
//Previous frame GTBBs center
84-
prevCenter.x = prevBB.x + prevBB.width / 2.0;
85-
prevCenter.y = prevBB.y + prevBB.height / 2.0;
84+
prevCenter.x = prevBB.x + prevBB.width / 2;
85+
prevCenter.y = prevBB.y + prevBB.height / 2;
8686

87-
targetPatchRect.x = prevCenter.x - prevBB.width*padTarget/2.0;
88-
targetPatchRect.y = prevCenter.y - prevBB.height*padTarget / 2.0;
89-
targetPatchRect.width = prevBB.width*padTarget;
90-
targetPatchRect.height = prevBB.height*padTarget;
87+
targetPatchRect.x = prevCenter.x - prevBB.width*padTarget/2;
88+
targetPatchRect.y = prevCenter.y - prevBB.height*padTarget / 2;
89+
targetPatchRect.width = (float)(prevBB.width*padTarget);
90+
targetPatchRect.height = (float)(prevBB.height*padTarget);
9191

9292
targetPatch = prevFrame(targetPatchRect);
9393

@@ -97,8 +97,8 @@ namespace cv
9797
TrainingSample sample;
9898

9999
//Current frame GTBBs center
100-
currCenter.x = currBB.x + currBB.width / 2.0;
101-
currCenter.y = currBB.y + currBB.height / 2.0;
100+
currCenter.x = (float)(currBB.x + currBB.width / 2.0);
101+
currCenter.y = (float)(currBB.y + currBB.height / 2.0);
102102

103103
//Generate and add random Laplacian distribution (Scaling from target size)
104104
double dx, dy, ds;
@@ -112,10 +112,10 @@ namespace cv
112112

113113
//cout << dx << " " << dy << " " << ds << endl;
114114

115-
searchPatchRect.width = prevBB.width*padSearch*ds;
116-
searchPatchRect.height = prevBB.height*padSearch*ds;
117-
searchPatchRect.x = currCenter.x + dx - searchPatchRect.width / 2;
118-
searchPatchRect.y = currCenter.y + dy - searchPatchRect.height / 2;
115+
searchPatchRect.width = (float)(prevBB.width*padSearch*ds);
116+
searchPatchRect.height = (float)(prevBB.height*padSearch*ds);
117+
searchPatchRect.x = (float)(currCenter.x + dx - searchPatchRect.width / 2.0);
118+
searchPatchRect.y = (float)(currCenter.y + dy - searchPatchRect.height / 2.0);
119119

120120
searchPatch = currFrame(searchPatchRect);
121121

0 commit comments

Comments
 (0)