1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

fixed warnings

This commit is contained in:
Ilya Lavrenov
2013-10-04 17:03:15 +04:00
parent b03c19a8ac
commit 35d9ce0c0c
23 changed files with 98 additions and 98 deletions
+9 -10
View File
@@ -46,11 +46,11 @@ using namespace std;
const int angularBins=12;
const int radialBins=4;
const float minRad=0.2;
const float minRad=0.2f;
const float maxRad=2;
const int NSN=5;//10;//20; //number of shapes per class
const int NP=100; //number of points sympliying the contour
const float outlierWeight=0.1;
const float outlierWeight=0.1f;
const int numOutliers=20;
const float CURRENT_MAX_ACCUR=95; //98% and 99% reached in several tests, 95 is fixed as minimum boundary
@@ -96,7 +96,7 @@ vector <Point2f> CV_ShapeEMDTest::convertContourType(const Mat& currentQuery, in
// In case actual number of points is less than n
int dum=0;
for (int add=contoursQuery.size()-1; add<n; add++)
for (int add=(int)contoursQuery.size()-1; add<n; add++)
{
contoursQuery.push_back(contoursQuery[dum++]); //adding dummy values
}
@@ -148,14 +148,14 @@ void CV_ShapeEMDTest::mpegTest()
listShapeNames(namesHeaders);
// distance matrix //
Mat distanceMat=Mat::zeros(NSN*namesHeaders.size(), NSN*namesHeaders.size(), CV_32F);
Mat distanceMat=Mat::zeros(NSN*(int)namesHeaders.size(), NSN*(int)namesHeaders.size(), CV_32F);
// query contours (normal v flipped, h flipped) and testing contour //
vector<Point2f> contoursQuery1, contoursQuery2, contoursQuery3, contoursTesting;
// reading query and computing its properties //
int counter=0;
const int loops=NSN*namesHeaders.size()*NSN*namesHeaders.size();
const int loops=NSN*(int)namesHeaders.size()*NSN*(int)namesHeaders.size();
for (size_t n=0; n<namesHeaders.size(); n++)
{
for (int i=1; i<=NSN; i++)
@@ -165,7 +165,6 @@ void CV_ShapeEMDTest::mpegTest()
thepathandname<<path+namesHeaders[n]<<"-"<<i<<".png";
Mat currentQuery, flippedHQuery, flippedVQuery;
currentQuery=imread(thepathandname.str(), IMREAD_GRAYSCALE);
Mat currentQueryBuf=currentQuery.clone();
flip(currentQuery, flippedHQuery, 0);
flip(currentQuery, flippedVQuery, 1);
// compute border of the query and its flipped versions //
@@ -184,8 +183,8 @@ void CV_ShapeEMDTest::mpegTest()
counter++;
if (nt==n && it==i)
{
distanceMat.at<float>(NSN*n+i-1,
NSN*nt+it-1)=0;
distanceMat.at<float>(NSN*(int)n+i-1,
NSN*(int)nt+it-1)=0;
continue;
}
// read testing image //
@@ -200,9 +199,9 @@ void CV_ShapeEMDTest::mpegTest()
std::cout<<std::endl<<"Progress: "<<counter<<"/"<<loops<<": "<<100*double(counter)/loops<<"% *******"<<std::endl;
std::cout<<"Computing shape distance between "<<namesHeaders[n]<<i<<
" and "<<namesHeaders[nt]<<it<<": ";
distanceMat.at<float>(NSN*n+i-1, NSN*nt+it-1)=
distanceMat.at<float>(NSN*(int)n+i-1, NSN*(int)nt+it-1)=
computeShapeDistance(contoursQuery1, contoursQuery2, contoursQuery3, contoursTesting);
std::cout<<distanceMat.at<float>(NSN*n+i-1, NSN*nt+it-1)<<std::endl;
std::cout<<distanceMat.at<float>(NSN*(int)n+i-1, NSN*(int)nt+it-1)<<std::endl;
}
}
}