]> rtime.felk.cvut.cz Git - opencv.git/commitdiff
fixed SWIG-based wrappers build + eliminated some warnings
authorvp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Tue, 19 Jan 2010 00:00:31 +0000 (00:00 +0000)
committervp153 <vp153@73c94f0f-984f-4a5f-82bc-2d8db8d8ee08>
Tue, 19 Jan 2010 00:00:31 +0000 (00:00 +0000)
git-svn-id: https://code.ros.org/svn/opencv/trunk@2578 73c94f0f-984f-4a5f-82bc-2d8db8d8ee08

opencv/interfaces/python/api
opencv/interfaces/swig/filtered/cv.h
opencv/interfaces/swig/general/memory.i
opencv/src/cxcore/cxarray.cpp
opencv/src/cxcore/cxmathfuncs.cpp
opencv/tests/cv/src/optflow.cpp

index a01f7847783ba7e1854b874f23db938cb2ca34cf..0ec84e06e8f8ef5e9cd1cb48f6196f17a51a8c82 100644 (file)
@@ -1192,9 +1192,6 @@ MinEnclosingCircle int,center,radius
   cvarrseq points
   CvPoint2D32f center /O
   float radius /O
-CalcPGH
-  CvSeq contour
-  CvHistogram hist
 
 # Planar Subdivisions
 
@@ -1373,11 +1370,6 @@ POSIT rotation_matrix,translation_vector
   CvTermCriteria criteria
   CvMatr32f_i rotation_matrix /O,A
   CvVect32f_i translation_vector /O,A
-CalcImageHomography intrinsic,homography
-  floats line
-  CvPoint3D32f* points
-  CvMatr32f_i intrinsic /O,A,/ch_Mat33
-  CvMatr32f_i homography /O,A
 
 EstimateRigidTransform
   CvArr A
index c34a38d801673e8c7eb32d846bd931077481e081..6496e2f96fc15875700d538fce62ade1874c9577 100644 (file)
@@ -2388,330 +2388,8 @@ extern "C" void cvSetNumThreads( int threads = 0 );
 
 extern "C" int cvGetThreadNum( void );
 
-
-
-typedef IplImage* ( * CvLoadImageFunc)( const char* filename, int colorness );
-typedef CvMat* ( * CvLoadImageMFunc)( const char* filename, int colorness );
-typedef int ( * CvSaveImageFunc)( const char* filename, const CvArr* image,
-                                          const int* params );
-typedef void ( * CvShowImageFunc)( const char* windowname, const CvArr* image );
-
-extern "C" int cvSetImageIOFunctions( CvLoadImageFunc _load_image, CvLoadImageMFunc _load_image_m,
-                            CvSaveImageFunc _save_image, CvShowImageFunc _show_image );
-
-
-
-
-
 }
 
-class CvImage
-{
-public:
-    CvImage() : image(0), refcount(0) {}
-    CvImage( CvSize size, int depth, int channels )
-    {
-        image = cvCreateImage( size, depth, channels );
-        refcount = image ? new int(1) : 0;
-    }
-
-    CvImage( IplImage* img ) : image(img)
-    {
-        refcount = image ? new int(1) : 0;
-    }
-
-    CvImage( const CvImage& img ) : image(img.image), refcount(img.refcount)
-    {
-        if( refcount ) ++(*refcount);
-    }
-
-    CvImage( const char* filename, const char* imgname=0, int color=-1 ) : image(0), refcount(0)
-    { load( filename, imgname, color ); }
-
-    CvImage( CvFileStorage* fs, const char* mapname, const char* imgname ) : image(0), refcount(0)
-    { read( fs, mapname, imgname ); }
-
-    CvImage( CvFileStorage* fs, const char* seqname, int idx ) : image(0), refcount(0)
-    { read( fs, seqname, idx ); }
-
-    ~CvImage()
-    {
-        if( refcount && !(--*refcount) )
-        {
-            cvReleaseImage( &image );
-            delete refcount;
-        }
-    }
-
-    CvImage clone() { return CvImage(image ? cvCloneImage(image) : 0); }
-
-    void create( CvSize size, int depth, int channels )
-    {
-        if( !image || !refcount ||
-            image->width != size.width || image->height != size.height ||
-            image->depth != depth || image->nChannels != channels )
-            attach( cvCreateImage( size, depth, channels ));
-    }
-
-    void release() { detach(); }
-    void clear() { detach(); }
-
-    void attach( IplImage* img, bool use_refcount=true )
-    {
-        if( refcount && --*refcount == 0 )
-        {
-            cvReleaseImage( &image );
-            delete refcount;
-        }
-        image = img;
-        refcount = use_refcount && image ? new int(1) : 0;
-    }
-
-    void detach()
-    {
-        if( refcount && --*refcount == 0 )
-        {
-            cvReleaseImage( &image );
-            delete refcount;
-        }
-        image = 0;
-        refcount = 0;
-    }
-
-    bool load( const char* filename, const char* imgname=0, int color=-1 );
-    bool read( CvFileStorage* fs, const char* mapname, const char* imgname );
-    bool read( CvFileStorage* fs, const char* seqname, int idx );
-    void save( const char* filename, const char* imgname, const int* params=0 );
-    void write( CvFileStorage* fs, const char* imgname );
-
-    void show( const char* window_name );
-    bool is_valid() { return image != 0; }
-
-    int width() const { return image ? image->width : 0; }
-    int height() const { return image ? image->height : 0; }
-
-    CvSize size() const { return image ? cvSize(image->width, image->height) : cvSize(0,0); }
-
-    CvSize roi_size() const
-    {
-        return !image ? cvSize(0,0) :
-            !image->roi ? cvSize(image->width,image->height) :
-            cvSize(image->roi->width, image->roi->height);
-    }
-
-    CvRect roi() const
-    {
-        return !image ? cvRect(0,0,0,0) :
-            !image->roi ? cvRect(0,0,image->width,image->height) :
-            cvRect(image->roi->xOffset,image->roi->yOffset,
-                   image->roi->width,image->roi->height);
-    }
-
-    int coi() const { return !image || !image->roi ? 0 : image->roi->coi; }
-
-    void set_roi(CvRect roi) { cvSetImageROI(image,roi); }
-    void reset_roi() { cvResetImageROI(image); }
-    void set_coi(int coi) { cvSetImageCOI(image,coi); }
-    int depth() const { return image ? image->depth : 0; }
-    int channels() const { return image ? image->nChannels : 0; }
-    int pix_size() const { return image ? ((image->depth & 255)>>3)*image->nChannels : 0; }
-
-    uchar* data() { return image ? (uchar*)image->imageData : 0; }
-    const uchar* data() const { return image ? (const uchar*)image->imageData : 0; }
-    int step() const { return image ? image->widthStep : 0; }
-    int origin() const { return image ? image->origin : 0; }
-
-    uchar* roi_row(int y)
-    {
-        assert(0<=y);
-        assert(!image ?
-                1 : image->roi ?
-                y<image->roi->height : y<image->height);
-
-        return !image ? 0 :
-            !image->roi ?
-                (uchar*)(image->imageData + y*image->widthStep) :
-                (uchar*)(image->imageData + (y+image->roi->yOffset)*image->widthStep +
-                image->roi->xOffset*((image->depth & 255)>>3)*image->nChannels);
-    }
-
-    const uchar* roi_row(int y) const
-    {
-        assert(0<=y);
-        assert(!image ?
-                1 : image->roi ?
-                y<image->roi->height : y<image->height);
-
-        return !image ? 0 :
-            !image->roi ?
-                (const uchar*)(image->imageData + y*image->widthStep) :
-                (const uchar*)(image->imageData + (y+image->roi->yOffset)*image->widthStep +
-                image->roi->xOffset*((image->depth & 255)>>3)*image->nChannels);
-    }
-
-    operator const IplImage* () const { return image; }
-    operator IplImage* () { return image; }
-
-    CvImage& operator = (const CvImage& img)
-    {
-        if( img.refcount )
-            ++*img.refcount;
-        if( refcount && !(--*refcount) )
-            cvReleaseImage( &image );
-        image=img.image;
-        refcount=img.refcount;
-        return *this;
-    }
-
-protected:
-    IplImage* image;
-    int* refcount;
-};
-
-
-class CvMatrix
-{
-public:
-    CvMatrix() : matrix(0) {}
-    CvMatrix( int rows, int cols, int type )
-    { matrix = cvCreateMat( rows, cols, type ); }
-
-    CvMatrix( int rows, int cols, int type, CvMat* hdr,
-              void* data=0, int step=0x7fffffff )
-    { matrix = cvInitMatHeader( hdr, rows, cols, type, data, step ); }
-
-    CvMatrix( int rows, int cols, int type, CvMemStorage* storage, bool alloc_data=true );
-
-    CvMatrix( int rows, int cols, int type, void* data, int step=0x7fffffff )
-    { matrix = cvCreateMatHeader( rows, cols, type );
-      cvSetData( matrix, data, step ); }
-
-    CvMatrix( CvMat* m )
-    { matrix = m; }
-
-    CvMatrix( const CvMatrix& m )
-    {
-        matrix = m.matrix;
-        addref();
-    }
-
-    CvMatrix( const char* filename, const char* matname=0, int color=-1 ) : matrix(0)
-    { load( filename, matname, color ); }
-
-    CvMatrix( CvFileStorage* fs, const char* mapname, const char* matname ) : matrix(0)
-    { read( fs, mapname, matname ); }
-
-    CvMatrix( CvFileStorage* fs, const char* seqname, int idx ) : matrix(0)
-    { read( fs, seqname, idx ); }
-
-    ~CvMatrix()
-    {
-        release();
-    }
-
-    CvMatrix clone() { return CvMatrix(matrix ? cvCloneMat(matrix) : 0); }
-
-    void set( CvMat* m, bool add_ref )
-    {
-        release();
-        matrix = m;
-        if( add_ref )
-            addref();
-    }
-
-    void create( int rows, int cols, int type )
-    {
-        if( !matrix || !matrix->refcount ||
-            matrix->rows != rows || matrix->cols != cols ||
-            ((matrix->type) & ((1 << 3)*64 - 1)) != type )
-            set( cvCreateMat( rows, cols, type ), false );
-    }
-
-    void addref() const
-    {
-        if( matrix )
-        {
-            if( matrix->hdr_refcount )
-                ++matrix->hdr_refcount;
-            else if( matrix->refcount )
-                ++*matrix->refcount;
-        }
-    }
-
-    void release()
-    {
-        if( matrix )
-        {
-            if( matrix->hdr_refcount )
-            {
-                if( --matrix->hdr_refcount == 0 )
-                    cvReleaseMat( &matrix );
-            }
-            else if( matrix->refcount )
-            {
-                if( --*matrix->refcount == 0 )
-                    (cvFree_(*(&matrix->refcount)), *(&matrix->refcount)=0);
-            }
-            matrix = 0;
-        }
-    }
-
-    void clear()
-    {
-        release();
-    }
-
-    bool load( const char* filename, const char* matname=0, int color=-1 );
-    bool read( CvFileStorage* fs, const char* mapname, const char* matname );
-    bool read( CvFileStorage* fs, const char* seqname, int idx );
-    void save( const char* filename, const char* matname, const int* params=0 );
-    void write( CvFileStorage* fs, const char* matname );
-
-    void show( const char* window_name );
-
-    bool is_valid() { return matrix != 0; }
-
-    int rows() const { return matrix ? matrix->rows : 0; }
-    int cols() const { return matrix ? matrix->cols : 0; }
-
-    CvSize size() const
-    {
-        return !matrix ? cvSize(0,0) : cvSize(matrix->rows,matrix->cols);
-    }
-
-    int type() const { return matrix ? ((matrix->type) & ((1 << 3)*64 - 1)) : 0; }
-    int depth() const { return matrix ? ((matrix->type) & ((1 << 3) - 1)) : 0; }
-    int channels() const { return matrix ? ((((matrix->type) & ((64 - 1) << 3)) >> 3) + 1) : 0; }
-    int pix_size() const { return matrix ? (((((matrix->type) & ((64 - 1) << 3)) >> 3) + 1) << ((((sizeof(size_t)/4+1)*16384|0x3a50) >> ((matrix->type) & ((1 << 3) - 1))*2) & 3)) : 0; }
-
-    uchar* data() { return matrix ? matrix->data.ptr : 0; }
-    const uchar* data() const { return matrix ? matrix->data.ptr : 0; }
-    int step() const { return matrix ? matrix->step : 0; }
-
-    void set_data( void* data, int step=0x7fffffff )
-    { cvSetData( matrix, data, step ); }
-
-    uchar* row(int i) { return !matrix ? 0 : matrix->data.ptr + i*matrix->step; }
-    const uchar* row(int i) const
-    { return !matrix ? 0 : matrix->data.ptr + i*matrix->step; }
-
-    operator const CvMat* () const { return matrix; }
-    operator CvMat* () { return matrix; }
-
-    CvMatrix& operator = (const CvMatrix& _m)
-    {
-        _m.addref();
-        release();
-        matrix = _m.matrix;
-        return *this;
-    }
-
-protected:
-    CvMat* matrix;
-};
-
-
-
 struct CvModule
 {
     CvModule( CvModuleInfo* _info );
@@ -2874,29 +2552,6 @@ typedef float ( * CvDistanceFunction)( const float* a, const float* b, void* use
 }
 
 
-typedef struct CvConDensation
-{
-    int MP;
-    int DP;
-    float* DynamMatr;
-    float* State;
-    int SamplesNum;
-    float** flSamples;
-    float** flNewSamples;
-    float* flConfidence;
-    float* flCumulative;
-    float* Temp;
-    float* RandomSample;
-    struct CvRandState* RandS;
-}
-CvConDensation;
-
-
-
-
-
-
-
 typedef struct CvKalman
 {
     int MP;
@@ -3355,21 +3010,6 @@ extern "C" int cvCamShift( const CvArr* prob_image, CvRect window,
 extern "C" int cvMeanShift( const CvArr* prob_image, CvRect window,
                         CvTermCriteria criteria, CvConnectedComp* comp );
 
-
-extern "C" CvConDensation* cvCreateConDensation( int dynam_params,
-                                             int measure_params,
-                                             int sample_count );
-
-
-extern "C" void cvReleaseConDensation( CvConDensation** condens );
-
-
-extern "C" void cvConDensUpdateByTime( CvConDensation* condens);
-
-
-extern "C" void cvConDensInitSampleSet( CvConDensation* condens, CvMat* lower_bound, CvMat* upper_bound );
-
-
 extern "C" CvKalman* cvCreateKalman( int dynam_params, int measure_params,
                                 int control_params = 0);
 
@@ -3484,22 +3124,11 @@ extern "C" CvSeq* cvApproxPoly( const void* src_seq,
 
 
 
-
-extern "C" CvSeq* cvFindDominantPoints( CvSeq* contour, CvMemStorage* storage,
-                                   int method = 1,
-                                   double parameter1 = 0,
-                                   double parameter2 = 0,
-                                   double parameter3 = 0,
-                                   double parameter4 = 0);
-
-
 extern "C" double cvArcLength( const void* curve,
                             CvSlice slice = cvSlice(0, 0x3fffffff),
                             int is_closed = -1);
 
 
-
-
 extern "C" CvRect cvBoundingRect( CvArr* points, int update = 0 );
 
 
@@ -3540,12 +3169,6 @@ extern "C" double cvMatchContourTrees( const CvContourTree* tree1,
                                     int method, double threshold );
 
 
-extern "C" void cvCalcPGH( const CvSeq* contour, CvHistogram* hist );
-
-
-
-
-
 extern "C" CvSeq* cvConvexHull2( const CvArr* input,
                              void* hull_storage = NULL,
                              int orientation = 1,
@@ -3686,14 +3309,6 @@ extern "C" void cvSnakeImage( const IplImage* image, CvPoint* points,
                            CvTermCriteria criteria, int calc_gradient = 1);
 
 
-extern "C" void cvCalcImageHomography( float* line, CvPoint3D32f* center,
-                                    float* intrinsic, float* homography );
-
-
-
-
-
-
 extern "C" void cvDistTransform( const CvArr* src, CvArr* dst,
                               int distance_type = 2,
                               int mask_size = 3,
index c19ae1246b76ae4bbc2db7fb908a162f0d49ce9f..2f3524dae077ca622c63df745a2b2dfa62ac0405 100644 (file)
 %nodefault CvKalman;
 %newobject cvCreateKalman;
 
-%nodefault CvConDensation;
-%newobject cvCreateConDensation;
-
-
 /****************************************************************************************\
 *                                  Histogram functions                                   *
 \****************************************************************************************/
index dfd1d2ba6da401c735721dd6f62b758bb584827f..e67ef7f0f065c8e232bdd6fb832143c2cdbc8159 100644 (file)
@@ -826,7 +826,7 @@ cvCreateData( CvArr* arr )
             int depth = img->depth;
             int width = img->width;
 
-            if( img->depth == IPL_DEPTH_32F || img->nChannels == 64 )
+            if( img->depth == IPL_DEPTH_32F || img->depth == IPL_DEPTH_64F )
             {
                 img->width *= img->depth == IPL_DEPTH_32F ? sizeof(float) : sizeof(double);
                 img->depth = IPL_DEPTH_8U;
index 13d7043d5e136950ac0d25a07a1d82338eb8c84d..c729fd21556fa7545060fc471f1677a4f9a92600 100644 (file)
@@ -2002,7 +2002,7 @@ double cv::solvePoly( const Mat& coeffs0, Mat& roots0, int maxIters )
         p = p * r;
     }
 
-    maxIters = maxIters <= 0 ? 300 : maxIters;
+    maxIters = maxIters <= 0 ? 1000 : maxIters;
     for( iter = 0; iter < maxIters; iter++ )
     {
         maxDiff = 0;
@@ -2023,6 +2023,14 @@ double cv::solvePoly( const Mat& coeffs0, Mat& roots0, int maxIters )
             break;
     }
 
+    if( coeffs0.channels() == 1 )
+    {
+        const double verySmallEps = 1e-100;
+        for( i = 0; i < n; i++ )
+            if( fabs(roots[i].im) < verySmallEps )
+                roots[i].im = 0;
+    }
+
     Mat(roots0.size(), CV_64FC2, roots).convertTo(roots0, roots0.type());
     return maxDiff;
 }
index 777423f55f5468afaf3a471eeb13b4696ae04c9b..e4e0d1b3bdf6306a28f9af0db343d6ec151383c4 100644 (file)
@@ -248,7 +248,7 @@ bool CV_OptFlowTest::runDense(const Point& d)
     //waitKey();   \r
 \r
     const double thres = 0.2;\r
-    if (errorLK > thres || errorBM > thres || errorFB > thres || errorFBG > thres /*|| errorHS > thres /**/)\r
+    if (errorLK > thres || errorBM > thres || errorFB > thres || errorFBG > thres /*|| errorHS > thres */)\r
     {        \r
         ts->set_failed_test_info(CvTS::FAIL_MISMATCH);\r
         return false;\r