Skip to content

Commit 226fd73

Browse files
committed
Merge pull request #3436 from mshabunin:fix-clang-warnings
2 parents 04d8492 + c56efb9 commit 226fd73

23 files changed

+4
-146
lines changed

modules/datasets/src/fr_adience.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ void FR_adienceImp::cv5ToSplits(vector< Ptr<FR_adienceObj> > fileList[5])
172172
void FR_adienceImp::loadDataset(const string &path)
173173
{
174174
// collect real image names
175-
unsigned int num = 0;
176175
vector<string> userNames;
177176
getDirList(path+"faces/", userNames);
178177
for (vector<string>::iterator itU=userNames.begin(); itU!=userNames.end(); ++itU)
@@ -185,11 +184,9 @@ void FR_adienceImp::loadDataset(const string &path)
185184
if (name.length()>3 && name.substr(name.length()-4) == ".jpg")
186185
{
187186
realNames[*itU].push_back(name);
188-
num++;
189187
}
190188
}
191189
}
192-
//printf("total images number: %u\n", num);
193190

194191
vector< Ptr<FR_adienceObj> > fileList[5];
195192
for (unsigned int i=0; i<5; ++i)

modules/datasets/src/track_alov.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ void TRACK_alovImpl::loadDataset(const string &rootPath)
247247
void TRACK_alovImpl::loadDatasetAnnotatedOnly(const string &rootPath)
248248
{
249249
vector <int> datasetsLengths;
250-
int currDatasetID = 0;
251250

252251
printf("ALOV300++ Annotated Dataset Initialization...\n");
253252

@@ -258,7 +257,6 @@ void TRACK_alovImpl::loadDatasetAnnotatedOnly(const string &rootPath)
258257
for (int k = 0; k < sectionSizes[i]; k++)
259258
{
260259
vector <Ptr<TRACK_alovObj> > objects;
261-
currDatasetID++;
262260

263261
//Open dataset's ground truth (annotation) file
264262
string annoPath = fullAnnoPath(rootPath, i, k);

modules/line_descriptor/src/binary_descriptor_matcher.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -639,9 +639,6 @@ void BinaryDescriptorMatcher::Mihasher::query( UINT32* results, UINT32* numres,
639639
/* number of results so far obtained (up to a distance of s per chunk) */
640640
UINT32 n = 0;
641641

642-
/* number of candidates tested with full codes (not counting duplicates) */
643-
UINT32 nc = 0;
644-
645642
UINT32 *arr;
646643
int size = 0;
647644
UINT32 index;
@@ -707,7 +704,6 @@ void BinaryDescriptorMatcher::Mihasher::query( UINT32* results, UINT32* numres,
707704
counter->set( index );
708705
hammd = cv::line_descriptor::match( codes.ptr() + (UINT64) index * ( B_over_8 ), Query, B_over_8 );
709706

710-
nc++;
711707
if( hammd <= D && numres[hammd] < maxres )
712708
res[hammd * K + numres[hammd]] = index + 1;
713709

modules/optflow/src/motempl.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,6 @@ void calcMotionGradient( InputArray _mhi, OutputArray _mask,
157157
double delta1, double delta2,
158158
int aperture_size )
159159
{
160-
static int runcase = 0; runcase++;
161-
162160
Mat mhi = _mhi.getMat();
163161
Size size = mhi.size();
164162

modules/optflow/src/rlof/berlof_invoker.hpp

-26
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,6 @@ class TrackerInvoker : public cv::ParallelLoopBody
189189
int buffIdx = 0;
190190
cv::Mat GMc0, GMc1, GMc2, GMc3;
191191
cv::Vec2f Mc0, Mc1, Mc2, Mc3;
192-
int noIteration = 0;
193-
int noReusedIteration = 0;
194-
int noSolvedIteration = 0;
195192
for( j = 0; j < criteria.maxCount; j++ )
196193
{
197194
cv::Point2f delta(0,0);
@@ -536,7 +533,6 @@ class TrackerInvoker : public cv::ParallelLoopBody
536533
{
537534
nextPts[ptidx] = backUpNextPt;
538535
}
539-
noIteration++;
540536
break;
541537
}
542538

@@ -612,13 +608,10 @@ class TrackerInvoker : public cv::ParallelLoopBody
612608
delta.y = inextPt.y + b - nextPt.y;
613609
} // isIn1 != isIn2
614610
}
615-
if( hasSolved == false)
616-
noIteration++;
617611
}
618612
else
619613
{
620614
hasSolved = false;
621-
noReusedIteration++;
622615
}
623616
if( hasSolved == false )
624617
{
@@ -635,7 +628,6 @@ class TrackerInvoker : public cv::ParallelLoopBody
635628
{
636629
nextPt += delta;
637630
nextPts[ptidx] = nextPt - halfWin;
638-
noSolvedIteration++;
639631
break;
640632
}
641633

@@ -832,9 +824,6 @@ class TrackerInvoker : public cv::ParallelLoopBody
832824
int buffIdx = 0;
833825
cv::Mat GMc0, GMc1, GMc2, GMc3;
834826
cv::Vec4f Mc0, Mc1, Mc2, Mc3;
835-
int noIteration = 0;
836-
int noReusedIteration = 0;
837-
int noSolvedIteration = 0;
838827
for( j = 0; j < criteria.maxCount; j++ )
839828
{
840829
cv::Point2f delta(0,0);
@@ -859,7 +848,6 @@ class TrackerInvoker : public cv::ParallelLoopBody
859848
nextPts[ptidx] = backUpNextPt;
860849
gainVecs[ptidx] = backUpGain;
861850
}
862-
noIteration++;
863851
break;
864852
}
865853

@@ -1287,7 +1275,6 @@ class TrackerInvoker : public cv::ParallelLoopBody
12871275
nextPts[ptidx] = backUpNextPt;
12881276
gainVecs[ptidx] = backUpGain;
12891277
}
1290-
noIteration++;
12911278
break;
12921279
}
12931280

@@ -1399,13 +1386,10 @@ class TrackerInvoker : public cv::ParallelLoopBody
13991386

14001387
} // isIn1 != isIn2
14011388
}
1402-
if( hasSolved == false)
1403-
noIteration++;
14041389
}
14051390
else
14061391
{
14071392
hasSolved = false;
1408-
noReusedIteration++;
14091393
}
14101394
if( hasSolved == false )
14111395
{
@@ -1430,7 +1414,6 @@ class TrackerInvoker : public cv::ParallelLoopBody
14301414
nextPt += delta;
14311415
nextPts[ptidx] = nextPt - halfWin;
14321416
gainVecs[ptidx]= gainVec + deltaGain;
1433-
noSolvedIteration++;
14341417
break;
14351418
}
14361419

@@ -1998,9 +1981,6 @@ namespace radial {
19981981
int j;
19991982
cv::Mat GMc0, GMc1, GMc2, GMc3;
20001983
cv::Vec4f Mc0, Mc1, Mc2, Mc3;
2001-
int noIteration = 0;
2002-
int noReusedIteration = 0;
2003-
int noSolvedIteration = 0;
20041984
for (j = 0; j < criteria.maxCount; j++)
20051985
{
20061986
cv::Point2f delta(0, 0);
@@ -2025,7 +2005,6 @@ namespace radial {
20252005
nextPts[ptidx] = backUpNextPt;
20262006
gainVecs[ptidx] = backUpGain;
20272007
}
2028-
noIteration++;
20292008
break;
20302009
}
20312010

@@ -2291,7 +2270,6 @@ namespace radial {
22912270
nextPts[ptidx] = backUpNextPt;
22922271
gainVecs[ptidx] = backUpGain;
22932272
}
2294-
noIteration++;
22952273
break;
22962274
}
22972275

@@ -2403,13 +2381,10 @@ namespace radial {
24032381

24042382
} // isIn1 != isIn2
24052383
}
2406-
if (hasSolved == false)
2407-
noIteration++;
24082384
}
24092385
else
24102386
{
24112387
hasSolved = false;
2412-
noReusedIteration++;
24132388
}
24142389
if (hasSolved == false)
24152390
{
@@ -2434,7 +2409,6 @@ namespace radial {
24342409
nextPt += delta;
24352410
nextPts[ptidx] = nextPt - halfWin;
24362411
gainVecs[ptidx] = gainVec + deltaGain;
2437-
noSolvedIteration++;
24382412
break;
24392413
}
24402414

modules/optflow/src/rlof/geo_interpolation.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -297,15 +297,12 @@ Mat interpolate_irregular_knn(
297297
}
298298
}
299299

300-
int global_time = 0;
301-
302300
bool done = false;
303301
while (!done) {
304302
if (my_agents.size() == 0) {
305303
done = true;
306304
break;
307305
}
308-
global_time++;
309306

310307
std::multimap<float, Vec2i >::iterator current_it = my_agents.begin();
311308
std::pair<float, Vec2i > current_p = *current_it;

modules/rgbd/src/nonrigid_icp.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,6 @@ bool ICPImpl::estimateWarpNodes(WarpField& currentWarp, const Affine3f &pose,
365365
std::cout << "median: " << med << " from " << residuals.size() << " residuals " << std::endl;
366366
float sigma = MAD_SCALE * median(residuals);
367367

368-
int pix_count = 0;
369-
370368
for(int y = 0; y < oldPoints.size().height; y++)
371369
{
372370
for(int x = 0; x < oldPoints.size().width; x++)
@@ -394,8 +392,6 @@ bool ICPImpl::estimateWarpNodes(WarpField& currentWarp, const Affine3f &pose,
394392

395393
float rd = Nc.at<Vec3f>(y, x).dot(diff);
396394

397-
pix_count++;
398-
399395
int n;
400396
nodeNeighboursType neighbours = volume->getVoxelNeighbours(p, n);
401397
float totalNeighbourWeight = 0.f;

modules/stereo/test/test_qds_matching.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,10 @@ static float disparity_MAE(const Mat &reference, const Mat &estimation)
1212
{
1313
int elems=0;
1414
float error=0;
15-
float ref_invalid=0;
1615
for (int row=0; row< reference.rows; row++){
1716
for (int col=0; col<reference.cols; col++){
1817
float ref_val = reference.at<float>(row, col);
1918
float estimated_val = estimation.at<float>(row, col);
20-
if (ref_val == 0){
21-
ref_invalid++;
22-
}
2319
// filter out pixels with unknown reference value and pixels whose disparity did not get estimated.
2420
if (estimated_val == 0 || ref_val == 0 || std::isnan(estimated_val)){
2521
continue;

modules/surface_matching/src/icp.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ int ICP::registerModelToScene(const Mat& srcPC, const Mat& dstPC, double& residu
367367
if (node)
368368
{
369369
// select the first node
370-
size_t idx = reinterpret_cast<size_t>(node->data)-1, dn=0;
370+
size_t idx = reinterpret_cast<size_t>(node->data)-1;
371371
int dup = (int)node->key-1;
372372
size_t minIdxD = idx;
373373
float minDist = distances[idx];
@@ -383,7 +383,6 @@ int ICP::registerModelToScene(const Mat& srcPC, const Mat& dstPC, double& residu
383383
}
384384

385385
node = node->next;
386-
dn++;
387386
}
388387

389388
indicesModel[ selInd ] = newI[ minIdxD ];

modules/text/src/ocr_beamsearch_decoder.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,6 @@ void OCRBeamSearchClassifierCNN::eval( InputArray _src, vector< vector<double> >
611611

612612
img = src(Rect(Point(x_c,0),Size(window_size,window_size)));
613613

614-
int patch_count = 0;
615614
vector< vector<double> > data_pool(9);
616615

617616

@@ -652,7 +651,6 @@ void OCRBeamSearchClassifierCNN::eval( InputArray _src, vector< vector<double> >
652651
data_pool[7].insert(data_pool[7].end(),patch.begin(),patch.end());
653652
if ((quad_id == 19)||(quad_id == 24)||(quad_id == 20)||(quad_id == 25))
654653
data_pool[8].insert(data_pool[8].end(),patch.begin(),patch.end());
655-
patch_count++;
656654
}
657655
}
658656

modules/text/src/ocr_hmm_decoder.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,6 @@ void OCRHMMClassifierCNN::eval( InputArray _src, vector<int>& out_class, vector<
10281028
Mat quad;
10291029
Mat tmp;
10301030

1031-
int patch_count = 0;
10321031
vector< vector<double> > data_pool(9);
10331032

10341033

@@ -1071,7 +1070,6 @@ void OCRHMMClassifierCNN::eval( InputArray _src, vector<int>& out_class, vector<
10711070
data_pool[7].insert(data_pool[7].end(),patch.begin(),patch.end());
10721071
if ((quad_id == 19)||(quad_id == 24)||(quad_id == 20)||(quad_id == 25))
10731072
data_pool[8].insert(data_pool[8].end(),patch.begin(),patch.end());
1074-
patch_count++;
10751073
}
10761074
}
10771075

modules/text/src/text_detector_swt.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,6 @@ vector<cv::Rect> findValidChains(const Mat& input_image, const Mat& SWTImage, co
597597
avgCompi.Blue /= compi.points.size();
598598
colorAverages.push_back(avgCompi);
599599
}
600-
int count = 0;
601600
std::vector<ChainedComponent> chains;
602601
for (size_t i = 0; i < components.size(); i++) {
603602
const Component& compi = components[i];
@@ -632,7 +631,6 @@ vector<cv::Rect> findValidChains(const Mat& input_image, const Mat& SWTImage, co
632631
dir.y = dy;
633632
chain.dir = dir;
634633
chains.push_back(chain);
635-
count++;
636634
}
637635

638636
}

modules/tracking/src/multiTracker.cpp

-21
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,12 @@ using namespace impl;
207207
tld::TrackerTLDImpl::Nexpert nExpert(imageForDetector, boundingBoxes[k], tldModel->detector, tracker->params);
208208
std::vector<Mat_<uchar> > examplesForModel, examplesForEnsemble;
209209
examplesForModel.reserve(100); examplesForEnsemble.reserve(100);
210-
int negRelabeled = 0;
211210
for (int i = 0; i < (int)detectorResults[k].size(); i++)
212211
{
213212
bool expertResult;
214213
if (detectorResults[k][i].isObject)
215214
{
216215
expertResult = nExpert(detectorResults[k][i].rect);
217-
if (expertResult != detectorResults[k][i].isObject)
218-
negRelabeled++;
219216
}
220217
else
221218
{
@@ -279,7 +276,6 @@ namespace impl {
279276
Mat tmp;
280277
int dx = initSize.width / 10, dy = initSize.height / 10;
281278
Size2d size = img.size();
282-
int npos = 0, nneg = 0;
283279
double maxSc = -5.0;
284280
Rect2d maxScRect;
285281
int scaleID;
@@ -404,8 +400,6 @@ namespace impl {
404400
//TLD Model Extraction
405401
tldModel = ((tld::TrackerTLDModel*)static_cast<TrackerModel*>(tracker->getModel()));
406402

407-
npos = 0;
408-
nneg = 0;
409403
maxSc = -5.0;
410404

411405
for (int i = 0; i < (int)ensBuffer[k].size(); i++)
@@ -427,13 +421,8 @@ namespace impl {
427421

428422
if (!labPatch.isObject)
429423
{
430-
nneg++;
431424
continue;
432425
}
433-
else
434-
{
435-
npos++;
436-
}
437426
scValue = tldModel->detector->Sc(standardPatch);
438427
if (scValue > maxSc)
439428
{
@@ -472,8 +461,6 @@ namespace impl {
472461
Mat tmp;
473462
int dx = initSize.width / 10, dy = initSize.height / 10;
474463
Size2d size = img.size();
475-
double scale = 1.0;
476-
int npos = 0, nneg = 0;
477464
double maxSc = -5.0;
478465
Rect2d maxScRect;
479466
int scaleID;
@@ -541,7 +528,6 @@ namespace impl {
541528
scaleID++;
542529
size.width /= tld::SCALE_STEP;
543530
size.height /= tld::SCALE_STEP;
544-
scale *= tld::SCALE_STEP;
545531
resize(img, tmp, size, 0, 0, tld::DOWNSCALE_MODE);
546532
resized_imgs.push_back(tmp);
547533
GaussianBlur(resized_imgs[scaleID], tmp, tld::GaussBlurKernelSize, 0.0f);
@@ -598,8 +584,6 @@ namespace impl {
598584
tracker = static_cast<tld::TrackerTLDImpl*>(trackerPtr);
599585
//TLD Model Extraction
600586
tldModel = ((tld::TrackerTLDModel*)static_cast<TrackerModel*>(tracker->getModel()));
601-
npos = 0;
602-
nneg = 0;
603587
maxSc = -5.0;
604588

605589
//Prepare batch of patches
@@ -639,13 +623,8 @@ namespace impl {
639623

640624
if (!labPatch.isObject)
641625
{
642-
nneg++;
643626
continue;
644627
}
645-
else
646-
{
647-
npos++;
648-
}
649628
scValue = resultSc[i];
650629
if (scValue > maxSc)
651630
{

0 commit comments

Comments
 (0)