@@ -132,25 +132,24 @@ namespace cv
132
132
Rect2d prevBB = ((TrackerGOTURNModel*)static_cast <TrackerModel*>(model))->getBoundingBox ();
133
133
Rect2d curBB;
134
134
135
- float padTarget = 2.0 ;
136
- float padSearch = 2.0 ;
135
+ float padTargetPatch = 2.0 ;
137
136
Rect2f searchPatchRect, targetPatchRect;
138
137
Point2f currCenter, prevCenter;
139
138
Mat prevFramePadded, curFramePadded;
140
139
Mat searchPatch, targetPatch;
141
140
142
- prevCenter.x = prevBB.x + prevBB.width / 2 ;
143
- prevCenter.y = prevBB.y + prevBB.height / 2 ;
141
+ prevCenter.x = ( float )( prevBB.x + prevBB.width / 2 ) ;
142
+ prevCenter.y = ( float )( prevBB.y + prevBB.height / 2 ) ;
144
143
145
- targetPatchRect.width = (float )(prevBB.width *padTarget );
146
- targetPatchRect.height = (float )(prevBB.height *padTarget );
147
- targetPatchRect.x = (float )(prevCenter.x - prevBB.width *padTarget / 2.0 + targetPatchRect.width );
148
- targetPatchRect.y = (float )(prevCenter.y - prevBB.height *padTarget / 2.0 + targetPatchRect.height );
144
+ targetPatchRect.width = (float )(prevBB.width *padTargetPatch );
145
+ targetPatchRect.height = (float )(prevBB.height *padTargetPatch );
146
+ targetPatchRect.x = (float )(prevCenter.x - prevBB.width *padTargetPatch / 2.0 + targetPatchRect.width );
147
+ targetPatchRect.y = (float )(prevCenter.y - prevBB.height *padTargetPatch / 2.0 + targetPatchRect.height );
149
148
150
- copyMakeBorder (prevFrame, prevFramePadded, targetPatchRect.height , targetPatchRect.height , targetPatchRect.width , targetPatchRect.width , BORDER_REPLICATE);
149
+ copyMakeBorder (prevFrame, prevFramePadded, ( int ) targetPatchRect.height , ( int ) targetPatchRect.height , ( int ) targetPatchRect.width , ( int ) targetPatchRect.width , BORDER_REPLICATE);
151
150
targetPatch = prevFramePadded (targetPatchRect).clone ();
152
151
153
- copyMakeBorder (curFrame, curFramePadded, targetPatchRect.height , targetPatchRect.height , targetPatchRect.width , targetPatchRect.width , BORDER_REPLICATE);
152
+ copyMakeBorder (curFrame, curFramePadded, ( int ) targetPatchRect.height , ( int ) targetPatchRect.height , ( int ) targetPatchRect.width , ( int ) targetPatchRect.width , BORDER_REPLICATE);
154
153
searchPatch = curFramePadded (targetPatchRect).clone ();
155
154
156
155
resize (targetPatch, targetPatch, Size (INPUT_SIZE, INPUT_SIZE));
0 commit comments