Commit 4a14795e authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

fixed several gcc 4.1 warnings

parent b80bdf32
...@@ -122,8 +122,9 @@ class FLANNException : public std::runtime_error { ...@@ -122,8 +122,9 @@ class FLANNException : public std::runtime_error {
struct CV_EXPORTS IndexParams { struct CV_EXPORTS IndexParams {
protected: protected:
IndexParams(flann_algorithm_t algorithm_) : algorithm(algorithm_) {}; IndexParams(flann_algorithm_t algorithm_) : algorithm(algorithm_) {};
public: public:
virtual ~IndexParams() {}
virtual flann_algorithm_t getIndexType() const = 0; virtual flann_algorithm_t getIndexType() const = 0;
virtual void print() const = 0; virtual void print() const = 0;
......
...@@ -591,7 +591,7 @@ icvApproxPolyDP( CvSeq* src_contour, int header_size, ...@@ -591,7 +591,7 @@ icvApproxPolyDP( CvSeq* src_contour, int header_size,
for( i = slice.start_index + 1; i < slice.end_index; i++ ) for( i = slice.start_index + 1; i < slice.end_index; i++ )
{ {
CV_READ_SEQ_ELEM( pt, reader ); 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 ) if( dist > max_dist )
{ {
...@@ -647,7 +647,7 @@ icvApproxPolyDP( CvSeq* src_contour, int header_size, ...@@ -647,7 +647,7 @@ icvApproxPolyDP( CvSeq* src_contour, int header_size,
dx = end_pt.x - start_pt.x; dx = end_pt.x - start_pt.x;
dy = end_pt.y - start_pt.y; 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 ) if( dist * dist <= 0.5*eps*(dx*dx + dy*dy) && dx != 0 && dy != 0 )
{ {
new_count--; new_count--;
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
/* Latent SVM prediction API */ /* Latent SVM prediction API */
/*****************************************************************************/ /*****************************************************************************/
#ifndef SVM_LATENTSVM #ifndef _LATENTSVM_H_
#define SVM_LATENTSVM #define _LATENTSVM_H_
#include <stdio.h> #include <stdio.h>
#include "_lsvm_types.h" #include "_lsvm_types.h"
...@@ -397,4 +397,4 @@ int showBoxes(IplImage *img, ...@@ -397,4 +397,4 @@ int showBoxes(IplImage *img,
const CvPoint *points, const CvPoint *oppositePoints, int kPoints, const CvPoint *points, const CvPoint *oppositePoints, int kPoints,
CvScalar color, int thickness, int line_type, int shift); CvScalar color, int thickness, int line_type, int shift);
#endif #endif
\ No newline at end of file
#ifndef LSVM_DIST_TRANSFORM #ifndef _LSVM_DIST_TRANSFORM_H_
#define LSVM_DIST_TRANSFORM #define _LSVM_DIST_TRANSFORM_H_
#include "_lsvm_types.h" #include "_lsvm_types.h"
#include "_lsvm_error.h" #include "_lsvm_error.h"
...@@ -135,4 +135,4 @@ int DistanceTransformTwoDimensionalProblem(const float *f, ...@@ -135,4 +135,4 @@ int DistanceTransformTwoDimensionalProblem(const float *f,
float *distanceTransform, float *distanceTransform,
int *pointsX, int *pointsY); int *pointsX, int *pointsY);
#endif #endif
\ No newline at end of file
#ifndef _LSVM_FFT_H #ifndef _LSVM_FFT_H_
#define _LSVM_FFT_H #define _LSVM_FFT_H_
#include "_lsvm_types.h" #include "_lsvm_types.h"
#include "_lsvm_error.h" #include "_lsvm_error.h"
...@@ -76,4 +76,4 @@ int fft2d(float *x_in, float *x_out, int numRows, int numColls); ...@@ -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); int fftInverse2d(float *x_in, float *x_out, int numRows, int numColls);
#endif #endif
\ No newline at end of file
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
/* Matching procedure API */ /* Matching procedure API */
/*****************************************************************************/ /*****************************************************************************/
// //
#ifndef SVM_MATCHING #ifndef _LSVM_MATCHING_H_
#define SVM_MATCHING #define _LSVM_MATCHING_H_
#include "_latentsvm.h" #include "_latentsvm.h"
#include "_lsvm_error.h" #include "_lsvm_error.h"
......
#ifndef RESIZEIMG #ifndef _LSVM_RESIZEIMG_H_
#define RESIZEIMG #define _LSVM_RESIZEIMG_H_
#include "_lsvm_types.h" #include "_lsvm_types.h"
...@@ -7,4 +7,4 @@ IplImage * resize_opencv (IplImage * img, float scale); ...@@ -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_dp1(IplImage * img, float scale, const int k);
IplImage * resize_article_dp(IplImage * img, float scale, const int k); IplImage * resize_article_dp(IplImage * img, float scale, const int k);
#endif #endif
\ No newline at end of file
#ifndef _LSVM_ROUTINE_H #ifndef _LSVM_ROUTINE_H_
#define _LSVM_ROUTINE_H #define _LSVM_ROUTINE_H_
#include "_lsvm_types.h" #include "_lsvm_types.h"
#include "_lsvm_error.h" #include "_lsvm_error.h"
...@@ -32,4 +32,4 @@ extern "C" ...@@ -32,4 +32,4 @@ extern "C"
int freeFeaturePyramidObject (CvLSVMFeaturePyramid **obj); int freeFeaturePyramidObject (CvLSVMFeaturePyramid **obj);
int allocFFTImage(CvLSVMFftImage **image, int p, int dimX, int dimY); int allocFFTImage(CvLSVMFftImage **image, int p, int dimX, int dimY);
int freeFFTImage(CvLSVMFftImage **image); int freeFFTImage(CvLSVMFftImage **image);
#endif #endif
\ No newline at end of file
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
// a(y - q1) + b(q1 - y)(q1 - y) + f[q1] // a(y - q1) + b(q1 - y)(q1 - y) + f[q1]
// a(y - q2) + b(q2 - y)(q2 - y) + f[q2] // a(y - q2) + b(q2 - y)(q2 - y) + f[q2]
// //
//
// API // API
// int GetPointOfIntersection(const float *f, // int GetPointOfIntersection(const float *f,
const float a, const float b, const float a, const float b,
...@@ -393,4 +394,4 @@ int DistanceTransformTwoDimensionalProblem(const float *f, ...@@ -393,4 +394,4 @@ int DistanceTransformTwoDimensionalProblem(const float *f,
free(internalDistTrans); free(internalDistTrans);
free(internalPointsX); free(internalPointsX);
return DISTANCE_TRANSFORM_OK; return DISTANCE_TRANSFORM_OK;
} }
\ No newline at end of file
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#define min(a,b) (((a) < (b)) ? (a) : (b)) #define min(a,b) (((a) < (b)) ? (a) : (b))
#endif #endif
int sign(float r){ static inline int sign(float r){
if(r > 0.0001f) return 1; if(r > 0.0001f) return 1;
if(r < -0.0001f) return -1; if(r < -0.0001f) return -1;
return 0; return 0;
...@@ -574,4 +574,4 @@ int addBordersToFeatureMaps(CvLSVMFeatureMap *map, const int bX, const int bY){ ...@@ -574,4 +574,4 @@ int addBordersToFeatureMaps(CvLSVMFeatureMap *map, const int bX, const int bY){
map->Map = new_data; map->Map = new_data;
return LATENT_SVM_OK; return LATENT_SVM_OK;
} }
\ No newline at end of file
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
// CvLatentSvmDetector* cvLoadLatentSvmDetector(const char* filename); // CvLatentSvmDetector* cvLoadLatentSvmDetector(const char* filename);
// INPUT // INPUT
// filename - path to the file containing the parameters of // filename - path to the file containing the parameters of
- trained Latent SVM detector // - trained Latent SVM detector
// OUTPUT // OUTPUT
// trained Latent SVM detector in internal representation // trained Latent SVM detector in internal representation
*/ */
...@@ -133,4 +133,4 @@ CvSeq* cvLatentSvmDetectObjects(IplImage* image, ...@@ -133,4 +133,4 @@ CvSeq* cvLatentSvmDetectObjects(IplImage* image,
free(score); free(score);
return result_seq; return result_seq;
} }
\ No newline at end of file
...@@ -803,6 +803,5 @@ int loadModel( ...@@ -803,6 +803,5 @@ int loadModel(
} }
(*kPartFilters)[0] = comp[0]; (*kPartFilters)[0] = comp[0];
//printf("end_parse\n");
return 0; return 0;
} }
\ No newline at end of file
...@@ -256,7 +256,7 @@ int convFFTConv2d(const CvLSVMFftImage *featMapImage, const CvLSVMFftImage *filt ...@@ -256,7 +256,7 @@ int convFFTConv2d(const CvLSVMFftImage *featMapImage, const CvLSVMFftImage *filt
imagesMultRes = (float *)malloc(sizeof(float) * size); imagesMultRes = (float *)malloc(sizeof(float) * size);
fftImagesMulti(featMapImage->channels[0], filterImage->channels[0], fftImagesMulti(featMapImage->channels[0], filterImage->channels[0],
featMapImage->dimY, featMapImage->dimX, imagesMultRes); 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], fftImagesMulti(featMapImage->channels[i],filterImage->channels[i],
featMapImage->dimY, featMapImage->dimX, imagesMult); featMapImage->dimY, featMapImage->dimX, imagesMult);
...@@ -1460,4 +1460,4 @@ int nonMaximumSuppression(int numBoxes, const CvPoint *points, ...@@ -1460,4 +1460,4 @@ int nonMaximumSuppression(int numBoxes, const CvPoint *points,
free(is_suppressed); free(is_suppressed);
return LATENT_SVM_OK; return LATENT_SVM_OK;
} }
\ No newline at end of file
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include <assert.h> #include <assert.h>
#include <math.h> #include <math.h>
IplImage * resize_opencv (IplImage * img, float scale){ IplImage * resize_opencv (IplImage * img, float scale){
IplImage * imgTmp; IplImage * imgTmp;
...@@ -241,4 +240,5 @@ IplImage * resize_opencv (IplImage * img, float scale){ ...@@ -241,4 +240,5 @@ IplImage * resize_opencv (IplImage * img, float scale){
// free(dst); // free(dst);
// free(tmp); // free(tmp);
// return imgTmp; // return imgTmp;
//} //}
\ No newline at end of file //
...@@ -91,7 +91,7 @@ int allocFFTImage(CvLSVMFftImage **image, int p, int dimX, int dimY) ...@@ -91,7 +91,7 @@ int allocFFTImage(CvLSVMFftImage **image, int p, int dimX, int dimY)
int freeFFTImage(CvLSVMFftImage **image) int freeFFTImage(CvLSVMFftImage **image)
{ {
unsigned int i; unsigned i;
if (*image == NULL) return LATENT_SVM_OK; if (*image == NULL) return LATENT_SVM_OK;
for (i = 0; i < (*image)->p; i++) for (i = 0; i < (*image)->p; i++)
{ {
...@@ -101,4 +101,4 @@ int freeFFTImage(CvLSVMFftImage **image) ...@@ -101,4 +101,4 @@ int freeFFTImage(CvLSVMFftImage **image)
free((*image)->channels); free((*image)->channels);
(*image)->channels = NULL; (*image)->channels = NULL;
return LATENT_SVM_OK; return LATENT_SVM_OK;
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment