mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
cppcheck: fix some reports
All of these: (performance) Prefer prefix ++/-- operators for non-primitive types. [modules/calib3d/src/fundam.cpp:1049] -> [modules/calib3d/src/fundam.cpp:1049]: (style) Same expression on both sides of '&&'.
This commit is contained in:
@@ -159,14 +159,14 @@ int main(int argc, char *argv[])
|
||||
String label;
|
||||
// Descriptor loop
|
||||
vector<String>::iterator itDesc;
|
||||
for (itDesc = typeDesc.begin(); itDesc != typeDesc.end(); itDesc++)
|
||||
for (itDesc = typeDesc.begin(); itDesc != typeDesc.end(); ++itDesc)
|
||||
{
|
||||
vector<KeyPoint> keyImg1;
|
||||
if (*itDesc == "BLOB")
|
||||
{
|
||||
b = SimpleBlobDetector::create(*itBLOB);
|
||||
label = Legende(*itBLOB);
|
||||
itBLOB++;
|
||||
++itBLOB;
|
||||
}
|
||||
try
|
||||
{
|
||||
@@ -181,7 +181,7 @@ int main(int argc, char *argv[])
|
||||
sbd->detect(img, keyImg, Mat());
|
||||
drawKeypoints(img, keyImg, result);
|
||||
int i = 0;
|
||||
for (vector<KeyPoint>::iterator k = keyImg.begin(); k != keyImg.end(); k++, i++)
|
||||
for (vector<KeyPoint>::iterator k = keyImg.begin(); k != keyImg.end(); ++k, ++i)
|
||||
circle(result, k->pt, (int)k->size, palette[i % 65536]);
|
||||
}
|
||||
namedWindow(*itDesc + label, WINDOW_AUTOSIZE);
|
||||
|
||||
@@ -466,7 +466,7 @@ int main(int argc, char *argv[])
|
||||
// Descriptor loop
|
||||
vector<String>::iterator itDesc;
|
||||
Mat result(img.rows, img.cols, CV_8UC3);
|
||||
for (itDesc = typeDesc.begin(); itDesc != typeDesc.end(); itDesc++)
|
||||
for (itDesc = typeDesc.begin(); itDesc != typeDesc.end(); ++itDesc)
|
||||
{
|
||||
vector<KeyPoint> keyImg1;
|
||||
if (*itDesc == "MSER"){
|
||||
@@ -475,7 +475,7 @@ int main(int argc, char *argv[])
|
||||
b = MSER::create(itMSER->delta, itMSER->minArea, itMSER->maxArea, itMSER->maxVariation, itMSER->minDiversity, itMSER->maxEvolution,
|
||||
itMSER->areaThreshold, itMSER->minMargin, itMSER->edgeBlurSize);
|
||||
label = Legende(*itMSER);
|
||||
itMSER++;
|
||||
++itMSER;
|
||||
|
||||
}
|
||||
else
|
||||
@@ -483,7 +483,7 @@ int main(int argc, char *argv[])
|
||||
b = MSER::create(itMSER->delta, itMSER->minArea, itMSER->maxArea, itMSER->maxVariation, itMSER->minDiversity);
|
||||
b.dynamicCast<MSER>()->setPass2Only(itMSER->pass2Only);
|
||||
label = Legende(*itMSER);
|
||||
itMSER++;
|
||||
++itMSER;
|
||||
}
|
||||
}
|
||||
if (img.type()==CV_8UC3)
|
||||
@@ -513,9 +513,9 @@ int main(int argc, char *argv[])
|
||||
int i = 0;
|
||||
//result = Scalar(0, 0, 0);
|
||||
int nbPixelInMSER=0;
|
||||
for (vector<vector <Point> >::iterator itr = region.begin(); itr != region.end(); itr++, i++)
|
||||
for (vector<vector <Point> >::iterator itr = region.begin(); itr != region.end(); ++itr, ++i)
|
||||
{
|
||||
for (vector <Point>::iterator itp = region[i].begin(); itp != region[i].end(); itp ++)
|
||||
for (vector <Point>::iterator itp = region[i].begin(); itp != region[i].end(); ++itp)
|
||||
{
|
||||
// all pixels belonging to region become blue
|
||||
result.at<Vec3b>(itp->y, itp->x) = Vec3b(128, 0, 0);
|
||||
|
||||
@@ -193,7 +193,7 @@ void detectAndDraw( Mat& img, CascadeClassifier& cascade,
|
||||
//|CASCADE_DO_ROUGH_SEARCH
|
||||
|CASCADE_SCALE_IMAGE,
|
||||
Size(30, 30) );
|
||||
for( vector<Rect>::const_iterator r = faces2.begin(); r != faces2.end(); r++ )
|
||||
for( vector<Rect>::const_iterator r = faces2.begin(); r != faces2.end(); ++r )
|
||||
{
|
||||
faces.push_back(Rect(smallImg.cols - r->x - r->width, r->y, r->width, r->height));
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Descriptor loop
|
||||
vector<String>::iterator itDesc;
|
||||
for (itDesc = typeDesc.begin(); itDesc != typeDesc.end(); itDesc++)
|
||||
for (itDesc = typeDesc.begin(); itDesc != typeDesc.end(); ++itDesc)
|
||||
{
|
||||
Ptr<DescriptorMatcher> descriptorMatcher;
|
||||
// Match between img1 and img2
|
||||
@@ -90,7 +90,7 @@ int main(int argc, char *argv[])
|
||||
// or detect and compute descriptors in one step
|
||||
b->detectAndCompute(img2, Mat(),keyImg2, descImg2,false);
|
||||
// Match method loop
|
||||
for (itMatcher = typeAlgoMatch.begin(); itMatcher != typeAlgoMatch.end(); itMatcher++){
|
||||
for (itMatcher = typeAlgoMatch.begin(); itMatcher != typeAlgoMatch.end(); ++itMatcher){
|
||||
descriptorMatcher = DescriptorMatcher::create(*itMatcher);
|
||||
if ((*itMatcher == "BruteForce-Hamming" || *itMatcher == "BruteForce-Hamming(2)") && (b->descriptorType() == CV_32F || b->defaultNorm() <= NORM_L2SQR))
|
||||
{
|
||||
@@ -135,7 +135,7 @@ int main(int argc, char *argv[])
|
||||
cout << "in img1\tin img2\n";
|
||||
// Use to compute distance between keyPoint matches and to evaluate match algorithm
|
||||
double cumSumDist2=0;
|
||||
for (it = bestMatches.begin(); it != bestMatches.end(); it++)
|
||||
for (it = bestMatches.begin(); it != bestMatches.end(); ++it)
|
||||
{
|
||||
cout << it->queryIdx << "\t" << it->trainIdx << "\t" << it->distance << "\n";
|
||||
Point2d p=keyImg1[it->queryIdx].pt-keyImg2[it->trainIdx].pt;
|
||||
@@ -165,15 +165,15 @@ int main(int argc, char *argv[])
|
||||
int i=0;
|
||||
cout << "Cumulative distance between keypoint match for different algorithm and feature detector \n\t";
|
||||
cout << "We cannot say which is the best but we can say results are differents! \n\t";
|
||||
for (vector<String>::iterator itMatcher = typeAlgoMatch.begin(); itMatcher != typeAlgoMatch.end(); itMatcher++)
|
||||
for (vector<String>::iterator itMatcher = typeAlgoMatch.begin(); itMatcher != typeAlgoMatch.end(); ++itMatcher)
|
||||
{
|
||||
cout<<*itMatcher<<"\t";
|
||||
}
|
||||
cout << "\n";
|
||||
for (itDesc = typeDesc.begin(); itDesc != typeDesc.end(); itDesc++)
|
||||
for (itDesc = typeDesc.begin(); itDesc != typeDesc.end(); ++itDesc)
|
||||
{
|
||||
cout << *itDesc << "\t";
|
||||
for (vector<String>::iterator itMatcher = typeAlgoMatch.begin(); itMatcher != typeAlgoMatch.end(); itMatcher++, i++)
|
||||
for (vector<String>::iterator itMatcher = typeAlgoMatch.begin(); itMatcher != typeAlgoMatch.end(); ++itMatcher, ++i)
|
||||
{
|
||||
cout << desMethCmp[i]<<"\t";
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ void detectAndDraw( Mat& img, CascadeClassifier& cascade,
|
||||
//|CASCADE_DO_ROUGH_SEARCH
|
||||
|CASCADE_SCALE_IMAGE,
|
||||
Size(30, 30) );
|
||||
for( vector<Rect>::const_iterator r = faces2.begin(); r != faces2.end(); r++ )
|
||||
for( vector<Rect>::const_iterator r = faces2.begin(); r != faces2.end(); ++r )
|
||||
{
|
||||
faces.push_back(Rect(smallImg.cols - r->x - r->width, r->y, r->width, r->height));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user