diff --git a/modules/flann/include/opencv2/flann/general.h b/modules/flann/include/opencv2/flann/general.h index 17a84922fc..078ff1617e 100644 --- a/modules/flann/include/opencv2/flann/general.h +++ b/modules/flann/include/opencv2/flann/general.h @@ -122,8 +122,9 @@ class FLANNException : public std::runtime_error { struct CV_EXPORTS IndexParams { protected: IndexParams(flann_algorithm_t algorithm_) : algorithm(algorithm_) {}; - + public: + virtual ~IndexParams() {} virtual flann_algorithm_t getIndexType() const = 0; virtual void print() const = 0; diff --git a/modules/imgproc/src/approx.cpp b/modules/imgproc/src/approx.cpp index dbc253faf3..fe86df3b4c 100644 --- a/modules/imgproc/src/approx.cpp +++ b/modules/imgproc/src/approx.cpp @@ -591,7 +591,7 @@ icvApproxPolyDP( CvSeq* src_contour, int header_size, for( i = slice.start_index + 1; i < slice.end_index; i++ ) { CV_READ_SEQ_ELEM( pt, reader ); - dist = abs((pt.y - start_pt.y) * dx - (pt.x - start_pt.x) * dy); + dist = fabs((pt.y - start_pt.y) * dx - (pt.x - start_pt.x) * dy); if( dist > max_dist ) { @@ -647,7 +647,7 @@ icvApproxPolyDP( CvSeq* src_contour, int header_size, dx = end_pt.x - start_pt.x; dy = end_pt.y - start_pt.y; - dist = abs((pt.x - start_pt.x)*dy - (pt.y - start_pt.y)*dx); + dist = fabs((pt.x - start_pt.x)*dy - (pt.y - start_pt.y)*dx); if( dist * dist <= 0.5*eps*(dx*dx + dy*dy) && dx != 0 && dy != 0 ) { new_count--; diff --git a/modules/objdetect/src/_latentsvm.h b/modules/objdetect/src/_latentsvm.h index e7cfc9c951..c3368c2ee2 100644 --- a/modules/objdetect/src/_latentsvm.h +++ b/modules/objdetect/src/_latentsvm.h @@ -2,8 +2,8 @@ /* Latent SVM prediction API */ /*****************************************************************************/ -#ifndef SVM_LATENTSVM -#define SVM_LATENTSVM +#ifndef _LATENTSVM_H_ +#define _LATENTSVM_H_ #include #include "_lsvm_types.h" @@ -397,4 +397,4 @@ int showBoxes(IplImage *img, const CvPoint *points, const CvPoint *oppositePoints, int kPoints, CvScalar color, int thickness, int line_type, int shift); -#endif \ No newline at end of file +#endif diff --git a/modules/objdetect/src/_lsvm_distancetransform.h b/modules/objdetect/src/_lsvm_distancetransform.h index 7d80c158e3..3ec6a96f03 100644 --- a/modules/objdetect/src/_lsvm_distancetransform.h +++ b/modules/objdetect/src/_lsvm_distancetransform.h @@ -1,5 +1,5 @@ -#ifndef LSVM_DIST_TRANSFORM -#define LSVM_DIST_TRANSFORM +#ifndef _LSVM_DIST_TRANSFORM_H_ +#define _LSVM_DIST_TRANSFORM_H_ #include "_lsvm_types.h" #include "_lsvm_error.h" @@ -135,4 +135,4 @@ int DistanceTransformTwoDimensionalProblem(const float *f, float *distanceTransform, int *pointsX, int *pointsY); -#endif \ No newline at end of file +#endif diff --git a/modules/objdetect/src/_lsvm_fft.h b/modules/objdetect/src/_lsvm_fft.h index 790bfb86be..83af8bc255 100644 --- a/modules/objdetect/src/_lsvm_fft.h +++ b/modules/objdetect/src/_lsvm_fft.h @@ -1,5 +1,5 @@ -#ifndef _LSVM_FFT_H -#define _LSVM_FFT_H +#ifndef _LSVM_FFT_H_ +#define _LSVM_FFT_H_ #include "_lsvm_types.h" #include "_lsvm_error.h" @@ -76,4 +76,4 @@ int fft2d(float *x_in, float *x_out, int numRows, int numColls); */ int fftInverse2d(float *x_in, float *x_out, int numRows, int numColls); -#endif \ No newline at end of file +#endif diff --git a/modules/objdetect/src/_lsvm_matching.h b/modules/objdetect/src/_lsvm_matching.h index 2c60ceedaa..1b51fc5f1f 100644 --- a/modules/objdetect/src/_lsvm_matching.h +++ b/modules/objdetect/src/_lsvm_matching.h @@ -2,8 +2,8 @@ /* Matching procedure API */ /*****************************************************************************/ // -#ifndef SVM_MATCHING -#define SVM_MATCHING +#ifndef _LSVM_MATCHING_H_ +#define _LSVM_MATCHING_H_ #include "_latentsvm.h" #include "_lsvm_error.h" diff --git a/modules/objdetect/src/_lsvm_resizeimg.h b/modules/objdetect/src/_lsvm_resizeimg.h index f0ac6c756c..c6ebc53357 100644 --- a/modules/objdetect/src/_lsvm_resizeimg.h +++ b/modules/objdetect/src/_lsvm_resizeimg.h @@ -1,5 +1,5 @@ -#ifndef RESIZEIMG -#define RESIZEIMG +#ifndef _LSVM_RESIZEIMG_H_ +#define _LSVM_RESIZEIMG_H_ #include "_lsvm_types.h" @@ -7,4 +7,4 @@ IplImage * resize_opencv (IplImage * img, float scale); IplImage * resize_article_dp1(IplImage * img, float scale, const int k); IplImage * resize_article_dp(IplImage * img, float scale, const int k); -#endif \ No newline at end of file +#endif diff --git a/modules/objdetect/src/_lsvm_routine.h b/modules/objdetect/src/_lsvm_routine.h index 815389da84..2249d3c769 100644 --- a/modules/objdetect/src/_lsvm_routine.h +++ b/modules/objdetect/src/_lsvm_routine.h @@ -1,5 +1,5 @@ -#ifndef _LSVM_ROUTINE_H -#define _LSVM_ROUTINE_H +#ifndef _LSVM_ROUTINE_H_ +#define _LSVM_ROUTINE_H_ #include "_lsvm_types.h" #include "_lsvm_error.h" @@ -32,4 +32,4 @@ extern "C" int freeFeaturePyramidObject (CvLSVMFeaturePyramid **obj); int allocFFTImage(CvLSVMFftImage **image, int p, int dimX, int dimY); int freeFFTImage(CvLSVMFftImage **image); -#endif \ No newline at end of file +#endif diff --git a/modules/objdetect/src/distancetransform.cpp b/modules/objdetect/src/distancetransform.cpp index 968bc254ce..cb81a1b660 100644 --- a/modules/objdetect/src/distancetransform.cpp +++ b/modules/objdetect/src/distancetransform.cpp @@ -7,6 +7,7 @@ // a(y - q1) + b(q1 - y)(q1 - y) + f[q1] // a(y - q2) + b(q2 - y)(q2 - y) + f[q2] // +// // API // int GetPointOfIntersection(const float *f, const float a, const float b, @@ -393,4 +394,4 @@ int DistanceTransformTwoDimensionalProblem(const float *f, free(internalDistTrans); free(internalPointsX); return DISTANCE_TRANSFORM_OK; -} \ No newline at end of file +} diff --git a/modules/objdetect/src/featurepyramid.cpp b/modules/objdetect/src/featurepyramid.cpp index e5e314c8e9..f5d4c51f0e 100644 --- a/modules/objdetect/src/featurepyramid.cpp +++ b/modules/objdetect/src/featurepyramid.cpp @@ -10,7 +10,7 @@ #define min(a,b) (((a) < (b)) ? (a) : (b)) #endif -int sign(float r){ +static inline int sign(float r){ if(r > 0.0001f) return 1; if(r < -0.0001f) return -1; return 0; @@ -574,4 +574,4 @@ int addBordersToFeatureMaps(CvLSVMFeatureMap *map, const int bX, const int bY){ map->Map = new_data; return LATENT_SVM_OK; -} \ No newline at end of file +} diff --git a/modules/objdetect/src/latentsvmdetector.cpp b/modules/objdetect/src/latentsvmdetector.cpp index f0f1d79590..34a1a493e8 100644 --- a/modules/objdetect/src/latentsvmdetector.cpp +++ b/modules/objdetect/src/latentsvmdetector.cpp @@ -9,7 +9,7 @@ // CvLatentSvmDetector* cvLoadLatentSvmDetector(const char* filename); // INPUT // filename - path to the file containing the parameters of - - trained Latent SVM detector +// - trained Latent SVM detector // OUTPUT // trained Latent SVM detector in internal representation */ @@ -133,4 +133,4 @@ CvSeq* cvLatentSvmDetectObjects(IplImage* image, free(score); return result_seq; -} \ No newline at end of file +} diff --git a/modules/objdetect/src/lsvmparser.cpp b/modules/objdetect/src/lsvmparser.cpp index 30f05914c1..4973f25d71 100644 --- a/modules/objdetect/src/lsvmparser.cpp +++ b/modules/objdetect/src/lsvmparser.cpp @@ -803,6 +803,5 @@ int loadModel( } (*kPartFilters)[0] = comp[0]; - //printf("end_parse\n"); return 0; -} \ No newline at end of file +} diff --git a/modules/objdetect/src/matching.cpp b/modules/objdetect/src/matching.cpp index 94170f9ef1..a49144cc04 100644 --- a/modules/objdetect/src/matching.cpp +++ b/modules/objdetect/src/matching.cpp @@ -256,7 +256,7 @@ int convFFTConv2d(const CvLSVMFftImage *featMapImage, const CvLSVMFftImage *filt imagesMultRes = (float *)malloc(sizeof(float) * size); fftImagesMulti(featMapImage->channels[0], filterImage->channels[0], featMapImage->dimY, featMapImage->dimX, imagesMultRes); - for (i = 1; (i < featMapImage->p) && (i < filterImage->p); i++) + for (i = 1; (i < (int)featMapImage->p) && (i < (int)filterImage->p); i++) { fftImagesMulti(featMapImage->channels[i],filterImage->channels[i], featMapImage->dimY, featMapImage->dimX, imagesMult); @@ -1460,4 +1460,4 @@ int nonMaximumSuppression(int numBoxes, const CvPoint *points, free(is_suppressed); return LATENT_SVM_OK; -} \ No newline at end of file +} diff --git a/modules/objdetect/src/resizeimg.cpp b/modules/objdetect/src/resizeimg.cpp index 1025829533..ac3ca348b1 100644 --- a/modules/objdetect/src/resizeimg.cpp +++ b/modules/objdetect/src/resizeimg.cpp @@ -4,7 +4,6 @@ #include #include - IplImage * resize_opencv (IplImage * img, float scale){ IplImage * imgTmp; @@ -241,4 +240,5 @@ IplImage * resize_opencv (IplImage * img, float scale){ // free(dst); // free(tmp); // return imgTmp; -//} \ No newline at end of file +//} +// diff --git a/modules/objdetect/src/routine.cpp b/modules/objdetect/src/routine.cpp index fbf8d98f1f..256aa9e24c 100644 --- a/modules/objdetect/src/routine.cpp +++ b/modules/objdetect/src/routine.cpp @@ -91,7 +91,7 @@ int allocFFTImage(CvLSVMFftImage **image, int p, int dimX, int dimY) int freeFFTImage(CvLSVMFftImage **image) { - unsigned int i; + unsigned i; if (*image == NULL) return LATENT_SVM_OK; for (i = 0; i < (*image)->p; i++) { @@ -101,4 +101,4 @@ int freeFFTImage(CvLSVMFftImage **image) free((*image)->channels); (*image)->channels = NULL; return LATENT_SVM_OK; -} \ No newline at end of file +}