fixed multiple warnings from VS2010.
This commit is contained in:
@@ -467,7 +467,7 @@ int VocData::getDetectorGroundTruth(const string& obj_class, const ObdDatasetTyp
|
||||
vector<ObdScoreIndexSorter> sorted_ids;
|
||||
{
|
||||
/* first count how many objects to allow preallocation */
|
||||
int obj_count = 0;
|
||||
size_t obj_count = 0;
|
||||
CV_Assert(images.size() == bounding_boxes.size());
|
||||
CV_Assert(scores.size() == bounding_boxes.size());
|
||||
for (size_t im_idx = 0; im_idx < scores.size(); ++im_idx)
|
||||
@@ -484,8 +484,8 @@ int VocData::getDetectorGroundTruth(const string& obj_class, const ObdDatasetTyp
|
||||
for (size_t ob_idx = 0; ob_idx < scores[im_idx].size(); ++ob_idx)
|
||||
{
|
||||
sorted_ids[flat_pos].score = scores[im_idx][ob_idx];
|
||||
sorted_ids[flat_pos].image_idx = im_idx;
|
||||
sorted_ids[flat_pos].obj_idx = ob_idx;
|
||||
sorted_ids[flat_pos].image_idx = (int)im_idx;
|
||||
sorted_ids[flat_pos].obj_idx = (int)ob_idx;
|
||||
++flat_pos;
|
||||
}
|
||||
}
|
||||
@@ -579,7 +579,7 @@ int VocData::getDetectorGroundTruth(const string& obj_class, const ObdDatasetTyp
|
||||
if (ov > maxov)
|
||||
{
|
||||
maxov = ov;
|
||||
max_gt_obj_idx = gt_obj_idx;
|
||||
max_gt_obj_idx = (int)gt_obj_idx;
|
||||
//store whether the maximum detection is marked as difficult or not
|
||||
max_is_difficult = (img_object_data[im_idx][gt_obj_idx].difficult);
|
||||
}
|
||||
@@ -854,7 +854,7 @@ void VocData::calcPrecRecall_impl(const vector<char>& ground_truth, const vector
|
||||
{
|
||||
recall_norm = recall_normalization;
|
||||
} else {
|
||||
recall_norm = std::count_if(ground_truth.begin(),ground_truth.end(),std::bind2nd(std::equal_to<bool>(),true));
|
||||
recall_norm = (int)std::count_if(ground_truth.begin(),ground_truth.end(),std::bind2nd(std::equal_to<bool>(),true));
|
||||
}
|
||||
|
||||
ap = 0;
|
||||
|
||||
@@ -191,8 +191,8 @@ void saveCameraParams( const string& filename,
|
||||
|
||||
if( !rvecs.empty() && !tvecs.empty() )
|
||||
{
|
||||
Mat bigmat(rvecs.size(), 6, CV_32F);
|
||||
for( size_t i = 0; i < rvecs.size(); i++ )
|
||||
Mat bigmat((int)rvecs.size(), 6, CV_32F);
|
||||
for( int i = 0; i < (int)rvecs.size(); i++ )
|
||||
{
|
||||
Mat r = bigmat(Range(i, i+1), Range(0,3));
|
||||
Mat t = bigmat(Range(i, i+1), Range(3,6));
|
||||
@@ -205,8 +205,8 @@ void saveCameraParams( const string& filename,
|
||||
|
||||
if( !imagePoints.empty() )
|
||||
{
|
||||
Mat imagePtMat(imagePoints.size(), imagePoints[0].size(), CV_32FC2);
|
||||
for( size_t i = 0; i < imagePoints.size(); i++ )
|
||||
Mat imagePtMat((int)imagePoints.size(), imagePoints[0].size(), CV_32FC2);
|
||||
for( int i = 0; i < (int)imagePoints.size(); i++ )
|
||||
{
|
||||
Mat r = imagePtMat.row(i).reshape(2, imagePtMat.cols);
|
||||
Mat imgpti(imagePoints[i]);
|
||||
|
||||
@@ -56,7 +56,7 @@ int main(int,char**)
|
||||
|
||||
vector<Point2f> points(20);
|
||||
for (size_t i = 0; i < points.size(); ++i)
|
||||
points[i] = Point2f(i * 5, i % 7);
|
||||
points[i] = Point2f((float)(i * 5), (float)(i % 7));
|
||||
|
||||
cout << "points = " << points << ";" << endl;
|
||||
return 0;
|
||||
|
||||
@@ -45,7 +45,7 @@ int getMatcherFilterType( const string& str )
|
||||
return NONE_FILTER;
|
||||
if( str == "CrossCheckFilter" )
|
||||
return CROSS_CHECK_FILTER;
|
||||
CV_Assert(0);
|
||||
CV_Error(CV_StsBadArg, "Invalid filter name");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ void doIteration( const Mat& img1, Mat& img2, bool isWarpPerspective,
|
||||
vector<Point2f> curve;
|
||||
Ptr<GenericDescriptorMatcher> gdm = new VectorDescriptorMatcher( descriptorExtractor, descriptorMatcher );
|
||||
evaluateGenericDescriptorMatcher( img1, img2, H12, keypoints1, keypoints2, 0, 0, curve, gdm );
|
||||
for( float l_p = 0; l_p < 1 - FLT_EPSILON; l_p+=0.1 )
|
||||
for( float l_p = 0; l_p < 1 - FLT_EPSILON; l_p+=0.1f )
|
||||
cout << "1-precision = " << l_p << "; recall = " << getRecall( curve, l_p ) << endl;
|
||||
cout << ">" << endl;
|
||||
}
|
||||
@@ -185,7 +185,7 @@ void doIteration( const Mat& img1, Mat& img2, bool isWarpPerspective,
|
||||
Mat points1t; perspectiveTransform(Mat(points1), points1t, H12);
|
||||
for( size_t i1 = 0; i1 < points1.size(); i1++ )
|
||||
{
|
||||
if( norm(points2[i1] - points1t.at<Point2f>(i1,0)) < 4 ) // inlier
|
||||
if( norm(points2[i1] - points1t.at<Point2f>((int)i1,0)) < 4 ) // inlier
|
||||
matchesMask[i1] = 1;
|
||||
}
|
||||
// draw inliers
|
||||
|
||||
@@ -51,7 +51,7 @@ struct MyData
|
||||
};
|
||||
|
||||
//These write and read functions must exist as per the inline functions in operations.hpp
|
||||
void write(FileStorage& fs, const std::string& name, const MyData& x){
|
||||
void write(FileStorage& fs, const std::string&, const MyData& x){
|
||||
x.write(fs);
|
||||
}
|
||||
void read(const FileNode& node, MyData& x, const MyData& default_value = MyData()){
|
||||
|
||||
Reference in New Issue
Block a user