more warnings fixed. +some warnings in examples
This commit is contained in:
parent
927dccb463
commit
8ebff41c29
@ -1929,8 +1929,8 @@ void cv::drawChessboardCorners( InputOutputArray _image, Size patternSize,
|
|||||||
bool cv::findCirclesGrid( const InputArray& _image, Size patternSize,
|
bool cv::findCirclesGrid( const InputArray& _image, Size patternSize,
|
||||||
OutputArray _centers, int flags, const Ptr<FeatureDetector> &blobDetector )
|
OutputArray _centers, int flags, const Ptr<FeatureDetector> &blobDetector )
|
||||||
{
|
{
|
||||||
bool isAsymmetricGrid = (bool)(flags & CALIB_CB_ASYMMETRIC_GRID);
|
bool isAsymmetricGrid = (flags & CALIB_CB_ASYMMETRIC_GRID) ? true : false;
|
||||||
bool isSymmetricGrid = (bool)(flags & CALIB_CB_SYMMETRIC_GRID);
|
bool isSymmetricGrid = (flags & CALIB_CB_SYMMETRIC_GRID ) ? true : false;
|
||||||
CV_Assert(isAsymmetricGrid ^ isSymmetricGrid);
|
CV_Assert(isAsymmetricGrid ^ isSymmetricGrid);
|
||||||
|
|
||||||
Mat image = _image.getMat();
|
Mat image = _image.getMat();
|
||||||
|
@ -2001,6 +2001,7 @@ float CvSVM::predict( const float* row_sample, int row_len, bool returnDFVal ) c
|
|||||||
|
|
||||||
int var_count = get_var_count();
|
int var_count = get_var_count();
|
||||||
assert( row_len == var_count );
|
assert( row_len == var_count );
|
||||||
|
(void)row_len;
|
||||||
|
|
||||||
int class_count = class_labels ? class_labels->cols :
|
int class_count = class_labels ? class_labels->cols :
|
||||||
params.svm_type == ONE_CLASS ? 1 : 0;
|
params.svm_type == ONE_CLASS ? 1 : 0;
|
||||||
|
@ -180,7 +180,7 @@ bool ASDFrameSequencer::isOpen()
|
|||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
void ASDFrameSequencer::getFrameCaption(char *caption) {
|
void ASDFrameSequencer::getFrameCaption(char* /*caption*/) {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ int main(int argc, char** argv)
|
|||||||
for( i = 0; i < (int)pairs.size(); i += 2 )
|
for( i = 0; i < (int)pairs.size(); i += 2 )
|
||||||
{
|
{
|
||||||
line( correspond, objKeypoints[pairs[i]].pt,
|
line( correspond, objKeypoints[pairs[i]].pt,
|
||||||
imgKeypoints[pairs[i+1]].pt + Point2f(0,object.rows),
|
imgKeypoints[pairs[i+1]].pt + Point2f(0,(float)object.rows),
|
||||||
Scalar(0,255,0) );
|
Scalar(0,255,0) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ IplImage* DrawCorrespondences(IplImage* img1, const vector<KeyPoint>& features1,
|
|||||||
|
|
||||||
for (size_t i = 0; i < features2.size(); i++)
|
for (size_t i = 0; i < features2.size(); i++)
|
||||||
{
|
{
|
||||||
CvPoint pt = cvPoint(features2[i].pt.x + img1->width, features2[i].pt.y);
|
CvPoint pt = cvPoint((int)features2[i].pt.x + img1->width, (int)features2[i].pt.y);
|
||||||
cvCircle(img_corr, pt, 3, CV_RGB(255, 0, 0));
|
cvCircle(img_corr, pt, 3, CV_RGB(255, 0, 0));
|
||||||
cvLine(img_corr, features1[desc_idx[i]].pt, pt, CV_RGB(0, 255, 0));
|
cvLine(img_corr, features1[desc_idx[i]].pt, pt, CV_RGB(0, 255, 0));
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
#include "opencv2/imgproc/imgproc.hpp"
|
#include "opencv2/imgproc/imgproc.hpp"
|
||||||
#include "opencv2/highgui/highgui.hpp"
|
#include "opencv2/highgui/highgui.hpp"
|
||||||
|
|
||||||
|
#include "opencv2/imgproc/imgproc_c.h"
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
#include "opencv2/imgproc/imgproc.hpp"
|
#include "opencv2/imgproc/imgproc.hpp"
|
||||||
#include "opencv2/highgui/highgui.hpp"
|
#include "opencv2/highgui/highgui.hpp"
|
||||||
|
#include "opencv2/imgproc/imgproc_c.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
void help()
|
void help()
|
||||||
|
@ -855,7 +855,7 @@ void VocData::calcPrecRecall_impl(const vector<char>& ground_truth, const vector
|
|||||||
{
|
{
|
||||||
recall_norm = recall_normalization;
|
recall_norm = recall_normalization;
|
||||||
} else {
|
} 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;
|
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
|
/* 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 */
|
it's necessary to extract the ground truth for the images under consideration */
|
||||||
getClassifierGroundTruth(obj_class, images, ground_truth);
|
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 */
|
/* iterate through images */
|
||||||
@ -2292,8 +2292,8 @@ void removeBowImageDescriptorsByCount( vector<ObdImage>& images, vector<Mat> bow
|
|||||||
const SVMTrainParamsExt& svmParamsExt, int descsToDelete )
|
const SVMTrainParamsExt& svmParamsExt, int descsToDelete )
|
||||||
{
|
{
|
||||||
RNG& rng = theRNG();
|
RNG& rng = theRNG();
|
||||||
int pos_ex = std::count( objectPresent.begin(), objectPresent.end(), true );
|
int pos_ex = std::count( objectPresent.begin(), objectPresent.end(), (char)1 );
|
||||||
int neg_ex = std::count( objectPresent.begin(), objectPresent.end(), false );
|
int neg_ex = std::count( objectPresent.begin(), objectPresent.end(), (char)0 );
|
||||||
|
|
||||||
while( descsToDelete != 0 )
|
while( descsToDelete != 0 )
|
||||||
{
|
{
|
||||||
|
@ -79,8 +79,8 @@ void colorizeDisparity( const Mat& gray, Mat& rgb, double maxDisp=-1.f, float S=
|
|||||||
float getMaxDisparity( VideoCapture& capture )
|
float getMaxDisparity( VideoCapture& capture )
|
||||||
{
|
{
|
||||||
const int minDistance = 400; // mm
|
const int minDistance = 400; // mm
|
||||||
float b = capture.get( CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE ); // mm
|
float b = (float)capture.get( CV_CAP_OPENNI_DEPTH_GENERATOR_BASELINE ); // mm
|
||||||
float F = capture.get( CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH ); // pixels
|
float F = (float)capture.get( CV_CAP_OPENNI_DEPTH_GENERATOR_FOCAL_LENGTH ); // pixels
|
||||||
return b * F / minDistance;
|
return b * F / minDistance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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 ok = read_num_class_data( data_filename, 16, &data, &responses );
|
||||||
int nsamples_all = 0, ntrain_samples = 0;
|
int nsamples_all = 0, ntrain_samples = 0;
|
||||||
int i, j;
|
//int i, j;
|
||||||
double train_hr = 0, test_hr = 0;
|
//double /*train_hr = 0,*/ test_hr = 0;
|
||||||
CvANN_MLP mlp;
|
CvANN_MLP mlp;
|
||||||
|
|
||||||
if( !ok )
|
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 ok = read_num_class_data( data_filename, 16, &data, &responses );
|
||||||
int nsamples_all = 0, ntrain_samples = 0;
|
int nsamples_all = 0, ntrain_samples = 0;
|
||||||
int i, j;
|
//int i, j;
|
||||||
double train_hr = 0, test_hr = 0;
|
//double /*train_hr = 0, */test_hr = 0;
|
||||||
CvANN_MLP mlp;
|
CvANN_MLP mlp;
|
||||||
|
|
||||||
if( !ok )
|
if( !ok )
|
||||||
@ -612,7 +612,7 @@ int build_nbayes_classifier( char* data_filename )
|
|||||||
CvMat *result = cvCreateMat(1, nsamples_all - ntrain_samples, CV_32FC1);
|
CvMat *result = cvCreateMat(1, nsamples_all - ntrain_samples, CV_32FC1);
|
||||||
(int)nbayes.predict(&sample, result);
|
(int)nbayes.predict(&sample, result);
|
||||||
int true_resp = 0;
|
int true_resp = 0;
|
||||||
int accuracy = 0;
|
//int accuracy = 0;
|
||||||
for (int i = 0; i < nsamples_all - ntrain_samples; i++)
|
for (int i = 0; i < nsamples_all - ntrain_samples; i++)
|
||||||
{
|
{
|
||||||
if (result->data.fl[i] == true_results[i])
|
if (result->data.fl[i] == true_results[i])
|
||||||
|
@ -155,7 +155,7 @@ void DetectAndDraw( Mat& img, CascadeClassifier& cascade)
|
|||||||
int radius;
|
int radius;
|
||||||
center.x = cvRound(r->x + r->width*0.5);
|
center.x = cvRound(r->x + r->width*0.5);
|
||||||
center.y = cvRound(r->y + r->height*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 );
|
circle( img, center, radius, color, 3, 8, 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -493,7 +493,7 @@ int main()
|
|||||||
|
|
||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
uchar key = waitKey();
|
uchar key = (uchar)waitKey();
|
||||||
|
|
||||||
if( key == 27 ) break;
|
if( key == 27 ) break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user