Skip to content

Commit

Permalink
Fix clang 14 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mshabunin committed Feb 6, 2023
1 parent 04d8492 commit c56efb9
Show file tree
Hide file tree
Showing 23 changed files with 4 additions and 146 deletions.
3 changes: 0 additions & 3 deletions modules/datasets/src/fr_adience.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ void FR_adienceImp::cv5ToSplits(vector< Ptr<FR_adienceObj> > fileList[5])
void FR_adienceImp::loadDataset(const string &path)
{
// collect real image names
unsigned int num = 0;
vector<string> userNames;
getDirList(path+"faces/", userNames);
for (vector<string>::iterator itU=userNames.begin(); itU!=userNames.end(); ++itU)
Expand All @@ -185,11 +184,9 @@ void FR_adienceImp::loadDataset(const string &path)
if (name.length()>3 && name.substr(name.length()-4) == ".jpg")
{
realNames[*itU].push_back(name);
num++;
}
}
}
//printf("total images number: %u\n", num);

vector< Ptr<FR_adienceObj> > fileList[5];
for (unsigned int i=0; i<5; ++i)
Expand Down
2 changes: 0 additions & 2 deletions modules/datasets/src/track_alov.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ void TRACK_alovImpl::loadDataset(const string &rootPath)
void TRACK_alovImpl::loadDatasetAnnotatedOnly(const string &rootPath)
{
vector <int> datasetsLengths;
int currDatasetID = 0;

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

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

//Open dataset's ground truth (annotation) file
string annoPath = fullAnnoPath(rootPath, i, k);
Expand Down
4 changes: 0 additions & 4 deletions modules/line_descriptor/src/binary_descriptor_matcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,9 +639,6 @@ void BinaryDescriptorMatcher::Mihasher::query( UINT32* results, UINT32* numres,
/* number of results so far obtained (up to a distance of s per chunk) */
UINT32 n = 0;

/* number of candidates tested with full codes (not counting duplicates) */
UINT32 nc = 0;

UINT32 *arr;
int size = 0;
UINT32 index;
Expand Down Expand Up @@ -707,7 +704,6 @@ void BinaryDescriptorMatcher::Mihasher::query( UINT32* results, UINT32* numres,
counter->set( index );
hammd = cv::line_descriptor::match( codes.ptr() + (UINT64) index * ( B_over_8 ), Query, B_over_8 );

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

Expand Down
2 changes: 0 additions & 2 deletions modules/optflow/src/motempl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,6 @@ void calcMotionGradient( InputArray _mhi, OutputArray _mask,
double delta1, double delta2,
int aperture_size )
{
static int runcase = 0; runcase++;

Mat mhi = _mhi.getMat();
Size size = mhi.size();

Expand Down
26 changes: 0 additions & 26 deletions modules/optflow/src/rlof/berlof_invoker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,6 @@ class TrackerInvoker : public cv::ParallelLoopBody
int buffIdx = 0;
cv::Mat GMc0, GMc1, GMc2, GMc3;
cv::Vec2f Mc0, Mc1, Mc2, Mc3;
int noIteration = 0;
int noReusedIteration = 0;
int noSolvedIteration = 0;
for( j = 0; j < criteria.maxCount; j++ )
{
cv::Point2f delta(0,0);
Expand Down Expand Up @@ -536,7 +533,6 @@ class TrackerInvoker : public cv::ParallelLoopBody
{
nextPts[ptidx] = backUpNextPt;
}
noIteration++;
break;
}

Expand Down Expand Up @@ -612,13 +608,10 @@ class TrackerInvoker : public cv::ParallelLoopBody
delta.y = inextPt.y + b - nextPt.y;
} // isIn1 != isIn2
}
if( hasSolved == false)
noIteration++;
}
else
{
hasSolved = false;
noReusedIteration++;
}
if( hasSolved == false )
{
Expand All @@ -635,7 +628,6 @@ class TrackerInvoker : public cv::ParallelLoopBody
{
nextPt += delta;
nextPts[ptidx] = nextPt - halfWin;
noSolvedIteration++;
break;
}

Expand Down Expand Up @@ -832,9 +824,6 @@ class TrackerInvoker : public cv::ParallelLoopBody
int buffIdx = 0;
cv::Mat GMc0, GMc1, GMc2, GMc3;
cv::Vec4f Mc0, Mc1, Mc2, Mc3;
int noIteration = 0;
int noReusedIteration = 0;
int noSolvedIteration = 0;
for( j = 0; j < criteria.maxCount; j++ )
{
cv::Point2f delta(0,0);
Expand All @@ -859,7 +848,6 @@ class TrackerInvoker : public cv::ParallelLoopBody
nextPts[ptidx] = backUpNextPt;
gainVecs[ptidx] = backUpGain;
}
noIteration++;
break;
}

Expand Down Expand Up @@ -1287,7 +1275,6 @@ class TrackerInvoker : public cv::ParallelLoopBody
nextPts[ptidx] = backUpNextPt;
gainVecs[ptidx] = backUpGain;
}
noIteration++;
break;
}

Expand Down Expand Up @@ -1399,13 +1386,10 @@ class TrackerInvoker : public cv::ParallelLoopBody

} // isIn1 != isIn2
}
if( hasSolved == false)
noIteration++;
}
else
{
hasSolved = false;
noReusedIteration++;
}
if( hasSolved == false )
{
Expand All @@ -1430,7 +1414,6 @@ class TrackerInvoker : public cv::ParallelLoopBody
nextPt += delta;
nextPts[ptidx] = nextPt - halfWin;
gainVecs[ptidx]= gainVec + deltaGain;
noSolvedIteration++;
break;
}

Expand Down Expand Up @@ -1998,9 +1981,6 @@ namespace radial {
int j;
cv::Mat GMc0, GMc1, GMc2, GMc3;
cv::Vec4f Mc0, Mc1, Mc2, Mc3;
int noIteration = 0;
int noReusedIteration = 0;
int noSolvedIteration = 0;
for (j = 0; j < criteria.maxCount; j++)
{
cv::Point2f delta(0, 0);
Expand All @@ -2025,7 +2005,6 @@ namespace radial {
nextPts[ptidx] = backUpNextPt;
gainVecs[ptidx] = backUpGain;
}
noIteration++;
break;
}

Expand Down Expand Up @@ -2291,7 +2270,6 @@ namespace radial {
nextPts[ptidx] = backUpNextPt;
gainVecs[ptidx] = backUpGain;
}
noIteration++;
break;
}

Expand Down Expand Up @@ -2403,13 +2381,10 @@ namespace radial {

} // isIn1 != isIn2
}
if (hasSolved == false)
noIteration++;
}
else
{
hasSolved = false;
noReusedIteration++;
}
if (hasSolved == false)
{
Expand All @@ -2434,7 +2409,6 @@ namespace radial {
nextPt += delta;
nextPts[ptidx] = nextPt - halfWin;
gainVecs[ptidx] = gainVec + deltaGain;
noSolvedIteration++;
break;
}

Expand Down
3 changes: 0 additions & 3 deletions modules/optflow/src/rlof/geo_interpolation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,15 +297,12 @@ Mat interpolate_irregular_knn(
}
}

int global_time = 0;

bool done = false;
while (!done) {
if (my_agents.size() == 0) {
done = true;
break;
}
global_time++;

std::multimap<float, Vec2i >::iterator current_it = my_agents.begin();
std::pair<float, Vec2i > current_p = *current_it;
Expand Down
4 changes: 0 additions & 4 deletions modules/rgbd/src/nonrigid_icp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,6 @@ bool ICPImpl::estimateWarpNodes(WarpField& currentWarp, const Affine3f &pose,
std::cout << "median: " << med << " from " << residuals.size() << " residuals " << std::endl;
float sigma = MAD_SCALE * median(residuals);

int pix_count = 0;

for(int y = 0; y < oldPoints.size().height; y++)
{
for(int x = 0; x < oldPoints.size().width; x++)
Expand Down Expand Up @@ -394,8 +392,6 @@ bool ICPImpl::estimateWarpNodes(WarpField& currentWarp, const Affine3f &pose,

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

pix_count++;

int n;
nodeNeighboursType neighbours = volume->getVoxelNeighbours(p, n);
float totalNeighbourWeight = 0.f;
Expand Down
4 changes: 0 additions & 4 deletions modules/stereo/test/test_qds_matching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@ static float disparity_MAE(const Mat &reference, const Mat &estimation)
{
int elems=0;
float error=0;
float ref_invalid=0;
for (int row=0; row< reference.rows; row++){
for (int col=0; col<reference.cols; col++){
float ref_val = reference.at<float>(row, col);
float estimated_val = estimation.at<float>(row, col);
if (ref_val == 0){
ref_invalid++;
}
// filter out pixels with unknown reference value and pixels whose disparity did not get estimated.
if (estimated_val == 0 || ref_val == 0 || std::isnan(estimated_val)){
continue;
Expand Down
3 changes: 1 addition & 2 deletions modules/surface_matching/src/icp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ int ICP::registerModelToScene(const Mat& srcPC, const Mat& dstPC, double& residu
if (node)
{
// select the first node
size_t idx = reinterpret_cast<size_t>(node->data)-1, dn=0;
size_t idx = reinterpret_cast<size_t>(node->data)-1;
int dup = (int)node->key-1;
size_t minIdxD = idx;
float minDist = distances[idx];
Expand All @@ -383,7 +383,6 @@ int ICP::registerModelToScene(const Mat& srcPC, const Mat& dstPC, double& residu
}

node = node->next;
dn++;
}

indicesModel[ selInd ] = newI[ minIdxD ];
Expand Down
2 changes: 0 additions & 2 deletions modules/text/src/ocr_beamsearch_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,6 @@ void OCRBeamSearchClassifierCNN::eval( InputArray _src, vector< vector<double> >

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

int patch_count = 0;
vector< vector<double> > data_pool(9);


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

Expand Down
2 changes: 0 additions & 2 deletions modules/text/src/ocr_hmm_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,6 @@ void OCRHMMClassifierCNN::eval( InputArray _src, vector<int>& out_class, vector<
Mat quad;
Mat tmp;

int patch_count = 0;
vector< vector<double> > data_pool(9);


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

Expand Down
2 changes: 0 additions & 2 deletions modules/text/src/text_detector_swt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,6 @@ vector<cv::Rect> findValidChains(const Mat& input_image, const Mat& SWTImage, co
avgCompi.Blue /= compi.points.size();
colorAverages.push_back(avgCompi);
}
int count = 0;
std::vector<ChainedComponent> chains;
for (size_t i = 0; i < components.size(); i++) {
const Component& compi = components[i];
Expand Down Expand Up @@ -632,7 +631,6 @@ vector<cv::Rect> findValidChains(const Mat& input_image, const Mat& SWTImage, co
dir.y = dy;
chain.dir = dir;
chains.push_back(chain);
count++;
}

}
Expand Down
21 changes: 0 additions & 21 deletions modules/tracking/src/multiTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,12 @@ using namespace impl;
tld::TrackerTLDImpl::Nexpert nExpert(imageForDetector, boundingBoxes[k], tldModel->detector, tracker->params);
std::vector<Mat_<uchar> > examplesForModel, examplesForEnsemble;
examplesForModel.reserve(100); examplesForEnsemble.reserve(100);
int negRelabeled = 0;
for (int i = 0; i < (int)detectorResults[k].size(); i++)
{
bool expertResult;
if (detectorResults[k][i].isObject)
{
expertResult = nExpert(detectorResults[k][i].rect);
if (expertResult != detectorResults[k][i].isObject)
negRelabeled++;
}
else
{
Expand Down Expand Up @@ -279,7 +276,6 @@ namespace impl {
Mat tmp;
int dx = initSize.width / 10, dy = initSize.height / 10;
Size2d size = img.size();
int npos = 0, nneg = 0;
double maxSc = -5.0;
Rect2d maxScRect;
int scaleID;
Expand Down Expand Up @@ -404,8 +400,6 @@ namespace impl {
//TLD Model Extraction
tldModel = ((tld::TrackerTLDModel*)static_cast<TrackerModel*>(tracker->getModel()));

npos = 0;
nneg = 0;
maxSc = -5.0;

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

if (!labPatch.isObject)
{
nneg++;
continue;
}
else
{
npos++;
}
scValue = tldModel->detector->Sc(standardPatch);
if (scValue > maxSc)
{
Expand Down Expand Up @@ -472,8 +461,6 @@ namespace impl {
Mat tmp;
int dx = initSize.width / 10, dy = initSize.height / 10;
Size2d size = img.size();
double scale = 1.0;
int npos = 0, nneg = 0;
double maxSc = -5.0;
Rect2d maxScRect;
int scaleID;
Expand Down Expand Up @@ -541,7 +528,6 @@ namespace impl {
scaleID++;
size.width /= tld::SCALE_STEP;
size.height /= tld::SCALE_STEP;
scale *= tld::SCALE_STEP;
resize(img, tmp, size, 0, 0, tld::DOWNSCALE_MODE);
resized_imgs.push_back(tmp);
GaussianBlur(resized_imgs[scaleID], tmp, tld::GaussBlurKernelSize, 0.0f);
Expand Down Expand Up @@ -598,8 +584,6 @@ namespace impl {
tracker = static_cast<tld::TrackerTLDImpl*>(trackerPtr);
//TLD Model Extraction
tldModel = ((tld::TrackerTLDModel*)static_cast<TrackerModel*>(tracker->getModel()));
npos = 0;
nneg = 0;
maxSc = -5.0;

//Prepare batch of patches
Expand Down Expand Up @@ -639,13 +623,8 @@ namespace impl {

if (!labPatch.isObject)
{
nneg++;
continue;
}
else
{
npos++;
}
scValue = resultSc[i];
if (scValue > maxSc)
{
Expand Down
Loading

0 comments on commit c56efb9

Please sign in to comment.