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

more warnings fixed. +some warnings in examples

This commit is contained in:
Anatoly Baksheev
2011-05-07 12:06:58 +00:00
parent 927dccb463
commit 8ebff41c29
12 changed files with 22 additions and 18 deletions
+4 -4
View File
@@ -855,7 +855,7 @@ void VocData::calcPrecRecall_impl(const vector<char>& ground_truth, const vector
{
recall_norm = recall_normalization;
} else {
recall_norm = (int)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<char>(),(char)1));
}
ap = 0;
@@ -985,7 +985,7 @@ void VocData::calcClassifierConfMatRow(const string& obj_class, const vector<Obd
/* in order to calculate the total number of relevant images for normalization of recall
it's necessary to extract the ground truth for the images under consideration */
getClassifierGroundTruth(obj_class, images, ground_truth);
total_relevant = std::count_if(ground_truth.begin(),ground_truth.end(),std::bind2nd(std::equal_to<bool>(),true));
total_relevant = std::count_if(ground_truth.begin(),ground_truth.end(),std::bind2nd(std::equal_to<char>(),(char)1));
}
/* iterate through images */
@@ -2292,8 +2292,8 @@ void removeBowImageDescriptorsByCount( vector<ObdImage>& images, vector<Mat> bow
const SVMTrainParamsExt& svmParamsExt, int descsToDelete )
{
RNG& rng = theRNG();
int pos_ex = std::count( objectPresent.begin(), objectPresent.end(), true );
int neg_ex = std::count( objectPresent.begin(), objectPresent.end(), false );
int pos_ex = std::count( objectPresent.begin(), objectPresent.end(), (char)1 );
int neg_ex = std::count( objectPresent.begin(), objectPresent.end(), (char)0 );
while( descsToDelete != 0 )
{
+2 -2
View File
@@ -79,8 +79,8 @@ void colorizeDisparity( const Mat& gray, Mat& rgb, double maxDisp=-1.f, float S=
float getMaxDisparity( VideoCapture& capture )
{
const int minDistance = 400; // mm
float b = capture.get( CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE ); // mm
float F = capture.get( CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH ); // pixels
float b = (float)capture.get( CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE ); // mm
float F = (float)capture.get( CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH ); // pixels
return b * F / minDistance;
}
+5 -5
View File
@@ -495,8 +495,8 @@ int build_knearest_classifier( char* data_filename, int K )
int ok = read_num_class_data( data_filename, 16, &data, &responses );
int nsamples_all = 0, ntrain_samples = 0;
int i, j;
double train_hr = 0, test_hr = 0;
//int i, j;
//double /*train_hr = 0,*/ test_hr = 0;
CvANN_MLP mlp;
if( !ok )
@@ -572,8 +572,8 @@ int build_nbayes_classifier( char* data_filename )
int ok = read_num_class_data( data_filename, 16, &data, &responses );
int nsamples_all = 0, ntrain_samples = 0;
int i, j;
double train_hr = 0, test_hr = 0;
//int i, j;
//double /*train_hr = 0, */test_hr = 0;
CvANN_MLP mlp;
if( !ok )
@@ -612,7 +612,7 @@ int build_nbayes_classifier( char* data_filename )
CvMat *result = cvCreateMat(1, nsamples_all - ntrain_samples, CV_32FC1);
(int)nbayes.predict(&sample, result);
int true_resp = 0;
int accuracy = 0;
//int accuracy = 0;
for (int i = 0; i < nsamples_all - ntrain_samples; i++)
{
if (result->data.fl[i] == true_results[i])
+1 -1
View File
@@ -155,7 +155,7 @@ void DetectAndDraw( Mat& img, CascadeClassifier& cascade)
int radius;
center.x = cvRound(r->x + r->width*0.5);
center.y = cvRound(r->y + r->height*0.5);
radius = cvRound(r->width + r->height)*0.25;
radius = (int)(cvRound(r->width + r->height)*0.25);
circle( img, center, radius, color, 3, 8, 0 );
}
+1 -1
View File
@@ -493,7 +493,7 @@ int main()
for(;;)
{
uchar key = waitKey();
uchar key = (uchar)waitKey();
if( key == 27 ) break;