Set stricter warning rules for gcc

This commit is contained in:
Andrey Kamaev 2012-06-07 17:21:29 +00:00
parent 0395f7c63f
commit 49a1ba6038
241 changed files with 9054 additions and 8947 deletions

View File

@ -42,6 +42,9 @@
#ifndef __CVCOMMON_H_ #ifndef __CVCOMMON_H_
#define __CVCOMMON_H_ #define __CVCOMMON_H_
#include "opencv2/core/core.hpp"
#include "opencv2/core/internal.hpp"
#include "cxcore.h" #include "cxcore.h"
#include "cv.h" #include "cv.h"
#include "cxmisc.h" #include "cxmisc.h"

View File

@ -80,11 +80,11 @@ typedef struct CvValArray
( *( (float*) (aux->data + ((int) (idx1)) * aux->step ) ) < \ ( *( (float*) (aux->data + ((int) (idx1)) * aux->step ) ) < \
*( (float*) (aux->data + ((int) (idx2)) * aux->step ) ) ) *( (float*) (aux->data + ((int) (idx2)) * aux->step ) ) )
CV_IMPLEMENT_QSORT_EX( icvSortIndexedValArray_16s, short, CMP_VALUES, CvValArray* ) static CV_IMPLEMENT_QSORT_EX( icvSortIndexedValArray_16s, short, CMP_VALUES, CvValArray* )
CV_IMPLEMENT_QSORT_EX( icvSortIndexedValArray_32s, int, CMP_VALUES, CvValArray* ) static CV_IMPLEMENT_QSORT_EX( icvSortIndexedValArray_32s, int, CMP_VALUES, CvValArray* )
CV_IMPLEMENT_QSORT_EX( icvSortIndexedValArray_32f, float, CMP_VALUES, CvValArray* ) static CV_IMPLEMENT_QSORT_EX( icvSortIndexedValArray_32f, float, CMP_VALUES, CvValArray* )
CV_BOOST_IMPL CV_BOOST_IMPL
void cvGetSortedIndices( CvMat* val, CvMat* idx, int sortcols ) void cvGetSortedIndices( CvMat* val, CvMat* idx, int sortcols )
@ -190,7 +190,7 @@ float cvEvalStumpClassifier( CvClassifier* classifier, CvMat* sample )
} }
#define ICV_DEF_FIND_STUMP_THRESHOLD( suffix, type, error ) \ #define ICV_DEF_FIND_STUMP_THRESHOLD( suffix, type, error ) \
CV_BOOST_IMPL int icvFindStumpThreshold_##suffix( \ static int icvFindStumpThreshold_##suffix( \
uchar* data, size_t datastep, \ uchar* data, size_t datastep, \
uchar* wdata, size_t wstep, \ uchar* wdata, size_t wstep, \
uchar* ydata, size_t ystep, \ uchar* ydata, size_t ystep, \
@ -1149,7 +1149,7 @@ float cvEvalCARTClassifier( CvClassifier* classifier, CvMat* sample )
return ((CvCARTClassifier*) classifier)->val[-idx]; return ((CvCARTClassifier*) classifier)->val[-idx];
} }
CV_BOOST_IMPL static
float cvEvalCARTClassifierIdx( CvClassifier* classifier, CvMat* sample ) float cvEvalCARTClassifierIdx( CvClassifier* classifier, CvMat* sample )
{ {
CV_FUNCNAME( "cvEvalCARTClassifierIdx" ); CV_FUNCNAME( "cvEvalCARTClassifierIdx" );
@ -1209,7 +1209,7 @@ void cvReleaseCARTClassifier( CvClassifier** classifier )
*classifier = NULL; *classifier = NULL;
} }
void CV_CDECL icvDefaultSplitIdx_R( int compidx, float threshold, static void CV_CDECL icvDefaultSplitIdx_R( int compidx, float threshold,
CvMat* idx, CvMat** left, CvMat** right, CvMat* idx, CvMat** left, CvMat** right,
void* userdata ) void* userdata )
{ {
@ -1258,7 +1258,7 @@ void CV_CDECL icvDefaultSplitIdx_R( int compidx, float threshold,
} }
} }
void CV_CDECL icvDefaultSplitIdx_C( int compidx, float threshold, static void CV_CDECL icvDefaultSplitIdx_C( int compidx, float threshold,
CvMat* idx, CvMat** left, CvMat** right, CvMat* idx, CvMat** left, CvMat** right,
void* userdata ) void* userdata )
{ {
@ -1529,7 +1529,7 @@ typedef struct CvBoostTrainer
* using ANY appropriate weak classifier * using ANY appropriate weak classifier
*/ */
CV_BOOST_IMPL static
CvBoostTrainer* icvBoostStartTraining( CvMat* trainClasses, CvBoostTrainer* icvBoostStartTraining( CvMat* trainClasses,
CvMat* weakTrainVals, CvMat* weakTrainVals,
CvMat* /*weights*/, CvMat* /*weights*/,
@ -1607,7 +1607,7 @@ CvBoostTrainer* icvBoostStartTraining( CvMat* trainClasses,
* Discrete AdaBoost functions * Discrete AdaBoost functions
* *
*/ */
CV_BOOST_IMPL static
float icvBoostNextWeakClassifierDAB( CvMat* weakEvalVals, float icvBoostNextWeakClassifierDAB( CvMat* weakEvalVals,
CvMat* trainClasses, CvMat* trainClasses,
CvMat* /*weakTrainVals*/, CvMat* /*weakTrainVals*/,
@ -1681,7 +1681,7 @@ float icvBoostNextWeakClassifierDAB( CvMat* weakEvalVals,
* Real AdaBoost functions * Real AdaBoost functions
* *
*/ */
CV_BOOST_IMPL static
float icvBoostNextWeakClassifierRAB( CvMat* weakEvalVals, float icvBoostNextWeakClassifierRAB( CvMat* weakEvalVals,
CvMat* trainClasses, CvMat* trainClasses,
CvMat* /*weakTrainVals*/, CvMat* /*weakTrainVals*/,
@ -1743,7 +1743,7 @@ float icvBoostNextWeakClassifierRAB( CvMat* weakEvalVals,
#define CV_LB_PROB_THRESH 0.01F #define CV_LB_PROB_THRESH 0.01F
#define CV_LB_WEIGHT_THRESHOLD 0.0001F #define CV_LB_WEIGHT_THRESHOLD 0.0001F
CV_BOOST_IMPL static
void icvResponsesAndWeightsLB( int num, uchar* wdata, int wstep, void icvResponsesAndWeightsLB( int num, uchar* wdata, int wstep,
uchar* ydata, int ystep, uchar* ydata, int ystep,
uchar* fdata, int fstep, uchar* fdata, int fstep,
@ -1772,7 +1772,7 @@ void icvResponsesAndWeightsLB( int num, uchar* wdata, int wstep,
} }
} }
CV_BOOST_IMPL static
CvBoostTrainer* icvBoostStartTrainingLB( CvMat* trainClasses, CvBoostTrainer* icvBoostStartTrainingLB( CvMat* trainClasses,
CvMat* weakTrainVals, CvMat* weakTrainVals,
CvMat* weights, CvMat* weights,
@ -1854,7 +1854,7 @@ CvBoostTrainer* icvBoostStartTrainingLB( CvMat* trainClasses,
return ptr; return ptr;
} }
CV_BOOST_IMPL static
float icvBoostNextWeakClassifierLB( CvMat* weakEvalVals, float icvBoostNextWeakClassifierLB( CvMat* weakEvalVals,
CvMat* trainClasses, CvMat* trainClasses,
CvMat* weakTrainVals, CvMat* weakTrainVals,
@ -1913,7 +1913,7 @@ float icvBoostNextWeakClassifierLB( CvMat* weakEvalVals,
* Gentle AdaBoost * Gentle AdaBoost
* *
*/ */
CV_BOOST_IMPL static
float icvBoostNextWeakClassifierGAB( CvMat* weakEvalVals, float icvBoostNextWeakClassifierGAB( CvMat* weakEvalVals,
CvMat* trainClasses, CvMat* trainClasses,
CvMat* /*weakTrainVals*/, CvMat* /*weakTrainVals*/,
@ -2071,7 +2071,7 @@ typedef struct CvBtTrainer
typedef void (*CvZeroApproxFunc)( float* approx, CvBtTrainer* trainer ); typedef void (*CvZeroApproxFunc)( float* approx, CvBtTrainer* trainer );
/* Mean zero approximation */ /* Mean zero approximation */
void icvZeroApproxMean( float* approx, CvBtTrainer* trainer ) static void icvZeroApproxMean( float* approx, CvBtTrainer* trainer )
{ {
int i; int i;
int idx; int idx;
@ -2088,7 +2088,7 @@ void icvZeroApproxMean( float* approx, CvBtTrainer* trainer )
/* /*
* Median zero approximation * Median zero approximation
*/ */
void icvZeroApproxMed( float* approx, CvBtTrainer* trainer ) static void icvZeroApproxMed( float* approx, CvBtTrainer* trainer )
{ {
int i; int i;
int idx; int idx;
@ -2106,7 +2106,7 @@ void icvZeroApproxMed( float* approx, CvBtTrainer* trainer )
/* /*
* 0.5 * log( mean(y) / (1 - mean(y)) ) where y in {0, 1} * 0.5 * log( mean(y) / (1 - mean(y)) ) where y in {0, 1}
*/ */
void icvZeroApproxLog( float* approx, CvBtTrainer* trainer ) static void icvZeroApproxLog( float* approx, CvBtTrainer* trainer )
{ {
float y_mean; float y_mean;
@ -2117,7 +2117,7 @@ void icvZeroApproxLog( float* approx, CvBtTrainer* trainer )
/* /*
* 0 zero approximation * 0 zero approximation
*/ */
void icvZeroApprox0( float* approx, CvBtTrainer* trainer ) static void icvZeroApprox0( float* approx, CvBtTrainer* trainer )
{ {
int i; int i;
@ -2143,7 +2143,7 @@ static CvZeroApproxFunc icvZeroApproxFunc[] =
CV_BOOST_IMPL CV_BOOST_IMPL
void cvBtNext( CvCARTClassifier** trees, CvBtTrainer* trainer ); void cvBtNext( CvCARTClassifier** trees, CvBtTrainer* trainer );
CV_BOOST_IMPL static
CvBtTrainer* cvBtStart( CvCARTClassifier** trees, CvBtTrainer* cvBtStart( CvCARTClassifier** trees,
CvMat* trainData, CvMat* trainData,
int flags, int flags,
@ -2270,7 +2270,7 @@ CvBtTrainer* cvBtStart( CvCARTClassifier** trees,
return ptr; return ptr;
} }
void icvBtNext_LSREG( CvCARTClassifier** trees, CvBtTrainer* trainer ) static void icvBtNext_LSREG( CvCARTClassifier** trees, CvBtTrainer* trainer )
{ {
int i; int i;
@ -2288,7 +2288,7 @@ void icvBtNext_LSREG( CvCARTClassifier** trees, CvBtTrainer* trainer )
} }
void icvBtNext_LADREG( CvCARTClassifier** trees, CvBtTrainer* trainer ) static void icvBtNext_LADREG( CvCARTClassifier** trees, CvBtTrainer* trainer )
{ {
CvCARTClassifier* ptr; CvCARTClassifier* ptr;
int i, j; int i, j;
@ -2361,7 +2361,7 @@ void icvBtNext_LADREG( CvCARTClassifier** trees, CvBtTrainer* trainer )
} }
void icvBtNext_MREG( CvCARTClassifier** trees, CvBtTrainer* trainer ) static void icvBtNext_MREG( CvCARTClassifier** trees, CvBtTrainer* trainer )
{ {
CvCARTClassifier* ptr; CvCARTClassifier* ptr;
int i, j; int i, j;
@ -2476,7 +2476,7 @@ void icvBtNext_MREG( CvCARTClassifier** trees, CvBtTrainer* trainer )
#define CV_LOG_VAL_MAX 18.0 #define CV_LOG_VAL_MAX 18.0
void icvBtNext_L2CLASS( CvCARTClassifier** trees, CvBtTrainer* trainer ) static void icvBtNext_L2CLASS( CvCARTClassifier** trees, CvBtTrainer* trainer )
{ {
CvCARTClassifier* ptr; CvCARTClassifier* ptr;
int i, j; int i, j;
@ -2617,7 +2617,7 @@ void icvBtNext_L2CLASS( CvCARTClassifier** trees, CvBtTrainer* trainer )
trees[0] = ptr; trees[0] = ptr;
} }
void icvBtNext_LKCLASS( CvCARTClassifier** trees, CvBtTrainer* trainer ) static void icvBtNext_LKCLASS( CvCARTClassifier** trees, CvBtTrainer* trainer )
{ {
int i, j, k, kk, num; int i, j, k, kk, num;
CvMat sample; CvMat sample;
@ -2781,7 +2781,7 @@ void icvBtNext_LKCLASS( CvCARTClassifier** trees, CvBtTrainer* trainer )
} }
void icvBtNext_XXBCLASS( CvCARTClassifier** trees, CvBtTrainer* trainer ) static void icvBtNext_XXBCLASS( CvCARTClassifier** trees, CvBtTrainer* trainer )
{ {
float alpha; float alpha;
int i; int i;
@ -2898,7 +2898,7 @@ void cvBtNext( CvCARTClassifier** trees, CvBtTrainer* trainer )
} }
} }
CV_BOOST_IMPL static
void cvBtEnd( CvBtTrainer** trainer ) void cvBtEnd( CvBtTrainer** trainer )
{ {
CV_FUNCNAME( "cvBtEnd" ); CV_FUNCNAME( "cvBtEnd" );
@ -2931,7 +2931,7 @@ void cvBtEnd( CvBtTrainer** trainer )
* Boosted tree model as a classifier * * Boosted tree model as a classifier *
\****************************************************************************************/ \****************************************************************************************/
CV_BOOST_IMPL static
float cvEvalBtClassifier( CvClassifier* classifier, CvMat* sample ) float cvEvalBtClassifier( CvClassifier* classifier, CvMat* sample )
{ {
float val; float val;
@ -2972,7 +2972,7 @@ float cvEvalBtClassifier( CvClassifier* classifier, CvMat* sample )
return val; return val;
} }
CV_BOOST_IMPL static
float cvEvalBtClassifier2( CvClassifier* classifier, CvMat* sample ) float cvEvalBtClassifier2( CvClassifier* classifier, CvMat* sample )
{ {
float val; float val;
@ -2988,7 +2988,7 @@ float cvEvalBtClassifier2( CvClassifier* classifier, CvMat* sample )
return (float) (val >= 0.0F); return (float) (val >= 0.0F);
} }
CV_BOOST_IMPL static
float cvEvalBtClassifierK( CvClassifier* classifier, CvMat* sample ) float cvEvalBtClassifierK( CvClassifier* classifier, CvMat* sample )
{ {
int cls = 0; int cls = 0;
@ -3072,7 +3072,7 @@ static CvEvalBtClassifier icvEvalBtClassifier[] =
cvEvalBtClassifier cvEvalBtClassifier
}; };
CV_BOOST_IMPL static
int cvSaveBtClassifier( CvClassifier* classifier, const char* filename ) int cvSaveBtClassifier( CvClassifier* classifier, const char* filename )
{ {
CV_FUNCNAME( "cvSaveBtClassifier" ); CV_FUNCNAME( "cvSaveBtClassifier" );
@ -3137,7 +3137,7 @@ int cvSaveBtClassifier( CvClassifier* classifier, const char* filename )
} }
CV_BOOST_IMPL static
void cvReleaseBtClassifier( CvClassifier** ptr ) void cvReleaseBtClassifier( CvClassifier** ptr )
{ {
CV_FUNCNAME( "cvReleaseBtClassifier" ); CV_FUNCNAME( "cvReleaseBtClassifier" );
@ -3183,7 +3183,7 @@ void cvReleaseBtClassifier( CvClassifier** ptr )
__END__; __END__;
} }
void cvTuneBtClassifier( CvClassifier* classifier, CvMat*, int flags, static void cvTuneBtClassifier( CvClassifier* classifier, CvMat*, int flags,
CvMat*, CvMat* , CvMat*, CvMat*, CvMat* ) CvMat*, CvMat* , CvMat*, CvMat*, CvMat* )
{ {
CV_FUNCNAME( "cvTuneBtClassifier" ); CV_FUNCNAME( "cvTuneBtClassifier" );
@ -3244,7 +3244,7 @@ void cvTuneBtClassifier( CvClassifier* classifier, CvMat*, int flags,
__END__; __END__;
} }
CvBtClassifier* icvAllocBtClassifier( CvBoostType type, int flags, int numclasses, static CvBtClassifier* icvAllocBtClassifier( CvBoostType type, int flags, int numclasses,
int numiter ) int numiter )
{ {
CvBtClassifier* ptr; CvBtClassifier* ptr;
@ -3720,7 +3720,7 @@ void cvWriteTrainData( const char* filename, int flags,
#define ICV_RAND_SHUFFLE( suffix, type ) \ #define ICV_RAND_SHUFFLE( suffix, type ) \
void icvRandShuffle_##suffix( uchar* data, size_t step, int num ) \ static void icvRandShuffle_##suffix( uchar* data, size_t step, int num ) \
{ \ { \
time_t seed; \ time_t seed; \
type tmp; \ type tmp; \

View File

@ -394,7 +394,7 @@ void icvSaveStageHaarClassifier( CvIntHaarClassifier* classifier, FILE* file )
CvIntHaarClassifier* icvLoadCARTStageHaarClassifierF( FILE* file, int step ) static CvIntHaarClassifier* icvLoadCARTStageHaarClassifierF( FILE* file, int step )
{ {
CvStageHaarClassifier* ptr = NULL; CvStageHaarClassifier* ptr = NULL;

View File

@ -1878,7 +1878,7 @@ int icvGetHaarTraininDataFromVecCallback( CvMat* img, void* userdata )
return 1; return 1;
} }
int icvGetHaarTrainingDataFromBGCallback ( CvMat* img, void* /*userdata*/ ) static int icvGetHaarTrainingDataFromBGCallback ( CvMat* img, void* /*userdata*/ )
{ {
if (! cvbgdata) if (! cvbgdata)
return 0; return 0;
@ -2215,7 +2215,7 @@ void cvCreateCascadeClassifier( const char* dirname,
/* tree cascade classifier */ /* tree cascade classifier */
int icvNumSplits( CvStageHaarClassifier* stage ) static int icvNumSplits( CvStageHaarClassifier* stage )
{ {
int i; int i;
int num; int num;
@ -2229,7 +2229,7 @@ int icvNumSplits( CvStageHaarClassifier* stage )
return num; return num;
} }
void icvSetNumSamples( CvHaarTrainingData* training_data, int num ) static void icvSetNumSamples( CvHaarTrainingData* training_data, int num )
{ {
assert( num <= training_data->maxnum ); assert( num <= training_data->maxnum );
@ -2238,7 +2238,7 @@ void icvSetNumSamples( CvHaarTrainingData* training_data, int num )
training_data->cls.cols = training_data->weights.cols = num; training_data->cls.cols = training_data->weights.cols = num;
} }
void icvSetWeightsAndClasses( CvHaarTrainingData* training_data, static void icvSetWeightsAndClasses( CvHaarTrainingData* training_data,
int num1, float weight1, float cls1, int num1, float weight1, float cls1,
int num2, float weight2, float cls2 ) int num2, float weight2, float cls2 )
{ {
@ -2258,7 +2258,7 @@ void icvSetWeightsAndClasses( CvHaarTrainingData* training_data,
} }
} }
CvMat* icvGetUsedValues( CvHaarTrainingData* training_data, static CvMat* icvGetUsedValues( CvHaarTrainingData* training_data,
int start, int num, int start, int num,
CvIntHaarFeatures* haar_features, CvIntHaarFeatures* haar_features,
CvStageHaarClassifier* stage ) CvStageHaarClassifier* stage )

View File

@ -83,7 +83,7 @@
* cij - coeffs[i][j], coeffs[2][2] = 1 * cij - coeffs[i][j], coeffs[2][2] = 1
* (ui, vi) - rectangle vertices * (ui, vi) - rectangle vertices
*/ */
void cvGetPerspectiveTransform( CvSize src_size, double quad[4][2], static void cvGetPerspectiveTransform( CvSize src_size, double quad[4][2],
double coeffs[3][3] ) double coeffs[3][3] )
{ {
//CV_FUNCNAME( "cvWarpPerspective" ); //CV_FUNCNAME( "cvWarpPerspective" );
@ -130,7 +130,7 @@ void cvGetPerspectiveTransform( CvSize src_size, double quad[4][2],
} }
/* Warps source into destination by a perspective transform */ /* Warps source into destination by a perspective transform */
void cvWarpPerspective( CvArr* src, CvArr* dst, double quad[4][2] ) static void cvWarpPerspective( CvArr* src, CvArr* dst, double quad[4][2] )
{ {
CV_FUNCNAME( "cvWarpPerspective" ); CV_FUNCNAME( "cvWarpPerspective" );

View File

@ -44,6 +44,9 @@
* *
* Measure performance of classifier * Measure performance of classifier
*/ */
#include "opencv2/core/core.hpp"
#include "opencv2/core/internal.hpp"
#include "cv.h" #include "cv.h"
#include "highgui.h" #include "highgui.h"

View File

@ -1,3 +1,6 @@
#include "opencv2/core/core.hpp"
#include "opencv2/core/internal.hpp"
#include "HOGfeatures.h" #include "HOGfeatures.h"
#include "cascadeclassifier.h" #include "cascadeclassifier.h"

View File

@ -1,3 +1,6 @@
#include "opencv2/core/core.hpp"
#include "opencv2/core/internal.hpp"
#include "boost.h" #include "boost.h"
#include "cascadeclassifier.h" #include "cascadeclassifier.h"
#include <queue> #include <queue>
@ -1232,7 +1235,7 @@ void CvCascadeBoostTree::split_node_data( CvDTreeNode* node )
data->free_node_data(node); data->free_node_data(node);
} }
void auxMarkFeaturesInMap( const CvDTreeNode* node, Mat& featureMap) static void auxMarkFeaturesInMap( const CvDTreeNode* node, Mat& featureMap)
{ {
if ( node && node->split ) if ( node && node->split )
{ {

View File

@ -1,3 +1,6 @@
#include "opencv2/core/core.hpp"
#include "opencv2/core/internal.hpp"
#include "cascadeclassifier.h" #include "cascadeclassifier.h"
#include <queue> #include <queue>

View File

@ -1,3 +1,6 @@
#include "opencv2/core/core.hpp"
#include "opencv2/core/internal.hpp"
#include "traincascade_features.h" #include "traincascade_features.h"
#include "cascadeclassifier.h" #include "cascadeclassifier.h"

View File

@ -1,3 +1,6 @@
#include "opencv2/core/core.hpp"
#include "opencv2/core/internal.hpp"
#include "haarfeatures.h" #include "haarfeatures.h"
#include "cascadeclassifier.h" #include "cascadeclassifier.h"

View File

@ -1,3 +1,6 @@
#include "opencv2/core/core.hpp"
#include "opencv2/core/internal.hpp"
#include "cv.h" #include "cv.h"
#include "imagestorage.h" #include "imagestorage.h"
#include <stdio.h> #include <stdio.h>

View File

@ -1,3 +1,6 @@
#include "opencv2/core/core.hpp"
#include "opencv2/core/internal.hpp"
#include "lbpfeatures.h" #include "lbpfeatures.h"
#include "cascadeclassifier.h" #include "cascadeclassifier.h"

View File

@ -1,3 +1,6 @@
#include "opencv2/core/core.hpp"
#include "opencv2/core/internal.hpp"
#include "cv.h" #include "cv.h"
#include "cascadeclassifier.h" #include "cascadeclassifier.h"

View File

@ -47,6 +47,9 @@ if(CMAKE_COMPILER_IS_GNUCXX)
# High level of warnings. # High level of warnings.
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -Wall") set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -Wall")
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=format-security")
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -Wmissing-declarations -Wcast-align -Wundef -Winit-self -Wpointer-arith") #-Wstrict-aliasing=2
# The -Wno-long-long is required in 64bit systems when including sytem headers. # The -Wno-long-long is required in 64bit systems when including sytem headers.
if(X86_64) if(X86_64)
set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -Wno-long-long") set(OPENCV_EXTRA_C_FLAGS "${OPENCV_EXTRA_C_FLAGS} -Wno-long-long")
@ -217,6 +220,10 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OPENCV_EXTRA_EXE_LINKER_
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE}") set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} ${OPENCV_EXTRA_EXE_LINKER_FLAGS_RELEASE}")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG}") set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} ${OPENCV_EXTRA_EXE_LINKER_FLAGS_DEBUG}")
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-prototypes -Wstrict-prototypes")
endif()
if(MSVC) if(MSVC)
# avoid warnings from MSVC about overriding the /W* option # avoid warnings from MSVC about overriding the /W* option
# we replace /W3 with /W4 only for C++ files, # we replace /W3 with /W4 only for C++ files,

View File

@ -72,6 +72,7 @@ MACRO(_PCH_WRITE_PCHDEP_CXX _targetName _include_file _dephelp)
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
OUTPUT "${${_dephelp}}" OUTPUT "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo "#include \\\"${_include_file}\\\"" > "${${_dephelp}}" COMMAND ${CMAKE_COMMAND} -E echo "#include \\\"${_include_file}\\\"" > "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo "int testfunction();" >> "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo "int testfunction()" >> "${${_dephelp}}" COMMAND ${CMAKE_COMMAND} -E echo "int testfunction()" >> "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo "{" >> "${${_dephelp}}" COMMAND ${CMAKE_COMMAND} -E echo "{" >> "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo " return 0;" >> "${${_dephelp}}" COMMAND ${CMAKE_COMMAND} -E echo " return 0;" >> "${${_dephelp}}"
@ -82,6 +83,7 @@ MACRO(_PCH_WRITE_PCHDEP_CXX _targetName _include_file _dephelp)
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
OUTPUT "${${_dephelp}}" OUTPUT "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo "\\#include \\\"${_include_file}\\\"" > "${${_dephelp}}" COMMAND ${CMAKE_COMMAND} -E echo "\\#include \\\"${_include_file}\\\"" > "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo "int testfunction\\(\\)\\;" >> "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo "int testfunction\\(\\)" >> "${${_dephelp}}" COMMAND ${CMAKE_COMMAND} -E echo "int testfunction\\(\\)" >> "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo "{" >> "${${_dephelp}}" COMMAND ${CMAKE_COMMAND} -E echo "{" >> "${${_dephelp}}"
COMMAND ${CMAKE_COMMAND} -E echo " \\return 0\\;" >> "${${_dephelp}}" COMMAND ${CMAKE_COMMAND} -E echo " \\return 0\\;" >> "${${_dephelp}}"

View File

@ -6,7 +6,7 @@
#include "opencv2/highgui/highgui.hpp" #include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp" #include "opencv2/imgproc/imgproc.hpp"
#if GTEST_CREATE_SHARED_LIBRARY #ifdef GTEST_CREATE_SHARED_LIBRARY
#error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined #error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined
#endif #endif

View File

@ -55,7 +55,7 @@
# endif # endif
#endif #endif
void icvGetQuadrangleHypotheses(CvSeq* contours, std::vector<std::pair<float, int> >& quads, int class_id) static void icvGetQuadrangleHypotheses(CvSeq* contours, std::vector<std::pair<float, int> >& quads, int class_id)
{ {
const float min_aspect_ratio = 0.3f; const float min_aspect_ratio = 0.3f;
const float max_aspect_ratio = 3.0f; const float max_aspect_ratio = 3.0f;
@ -80,7 +80,7 @@ void icvGetQuadrangleHypotheses(CvSeq* contours, std::vector<std::pair<float, in
} }
} }
void countClasses(const std::vector<std::pair<float, int> >& pairs, size_t idx1, size_t idx2, std::vector<int>& counts) static void countClasses(const std::vector<std::pair<float, int> >& pairs, size_t idx1, size_t idx2, std::vector<int>& counts)
{ {
counts.assign(2, 0); counts.assign(2, 0);
for(size_t i = idx1; i != idx2; i++) for(size_t i = idx1; i != idx2; i++)
@ -89,7 +89,7 @@ void countClasses(const std::vector<std::pair<float, int> >& pairs, size_t idx1,
} }
} }
bool less_pred(const std::pair<float, int>& p1, const std::pair<float, int>& p2) inline bool less_pred(const std::pair<float, int>& p1, const std::pair<float, int>& p2)
{ {
return p1.first < p2.first; return p1.first < p2.first;
} }

View File

@ -1223,7 +1223,7 @@ void computePredecessorMatrix(const Mat &dm, int verticesCount, Mat &predecessor
} }
} }
void computeShortestPath(Mat &predecessorMatrix, size_t v1, size_t v2, vector<size_t> &path) static void computeShortestPath(Mat &predecessorMatrix, size_t v1, size_t v2, vector<size_t> &path)
{ {
if (predecessorMatrix.at<int> ((int)v1, (int)v2) < 0) if (predecessorMatrix.at<int> ((int)v1, (int)v2) < 0)
{ {
@ -1403,7 +1403,7 @@ void CirclesGridFinder::getHoles(vector<Point2f> &outHoles) const
} }
} }
bool areIndicesCorrect(Point pos, vector<vector<size_t> > *points) static bool areIndicesCorrect(Point pos, vector<vector<size_t> > *points)
{ {
if (pos.y < 0 || pos.x < 0) if (pos.y < 0 || pos.x < 0)
return false; return false;

View File

@ -42,7 +42,7 @@
#ifndef __OPENCV_PRECOMP_H__ #ifndef __OPENCV_PRECOMP_H__
#define __OPENCV_PRECOMP_H__ #define __OPENCV_PRECOMP_H__
#if _MSC_VER >= 1200 #if defined _MSC_VER && _MSC_VER >= 1200
#pragma warning( disable: 4251 4710 4711 4514 4996 ) #pragma warning( disable: 4251 4710 4711 4514 4996 )
#endif #endif

View File

@ -54,39 +54,39 @@
namespace cv { namespace cv {
void drawCircles(Mat& img, const vector<Point2f>& corners, const vector<float>& radius) // static void drawCircles(Mat& img, const vector<Point2f>& corners, const vector<float>& radius)
{ // {
for(size_t i = 0; i < corners.size(); i++) // for(size_t i = 0; i < corners.size(); i++)
{ // {
circle(img, corners[i], cvRound(radius[i]), CV_RGB(255, 0, 0)); // circle(img, corners[i], cvRound(radius[i]), CV_RGB(255, 0, 0));
} // }
} // }
int histQuantile(const Mat& hist, float quantile) // static int histQuantile(const Mat& hist, float quantile)
{ // {
if(hist.dims > 1) return -1; // works for 1D histograms only // if(hist.dims > 1) return -1; // works for 1D histograms only
float cur_sum = 0; // float cur_sum = 0;
float total_sum = (float)sum(hist).val[0]; // float total_sum = (float)sum(hist).val[0];
float quantile_sum = total_sum*quantile; // float quantile_sum = total_sum*quantile;
for(int j = 0; j < hist.size[0]; j++) // for(int j = 0; j < hist.size[0]; j++)
{ // {
cur_sum += (float)hist.at<float>(j); // cur_sum += (float)hist.at<float>(j);
if(cur_sum > quantile_sum) // if(cur_sum > quantile_sum)
{ // {
return j; // return j;
} // }
} // }
return hist.size[0] - 1; // return hist.size[0] - 1;
} // }
bool is_smaller(const std::pair<int, float>& p1, const std::pair<int, float>& p2) inline bool is_smaller(const std::pair<int, float>& p1, const std::pair<int, float>& p2)
{ {
return p1.second < p2.second; return p1.second < p2.second;
} }
void orderContours(const vector<vector<Point> >& contours, Point2f point, vector<std::pair<int, float> >& order) static void orderContours(const vector<vector<Point> >& contours, Point2f point, vector<std::pair<int, float> >& order)
{ {
order.clear(); order.clear();
size_t i, j, n = contours.size(); size_t i, j, n = contours.size();
@ -106,16 +106,16 @@ void orderContours(const vector<vector<Point> >& contours, Point2f point, vector
} }
// fit second order curve to a set of 2D points // fit second order curve to a set of 2D points
void fitCurve2Order(const vector<Point2f>& /*points*/, vector<float>& /*curve*/) inline void fitCurve2Order(const vector<Point2f>& /*points*/, vector<float>& /*curve*/)
{ {
// TBD // TBD
} }
void findCurvesCross(const vector<float>& /*curve1*/, const vector<float>& /*curve2*/, Point2f& /*cross_point*/) inline void findCurvesCross(const vector<float>& /*curve1*/, const vector<float>& /*curve2*/, Point2f& /*cross_point*/)
{ {
} }
void findLinesCrossPoint(Point2f origin1, Point2f dir1, Point2f origin2, Point2f dir2, Point2f& cross_point) static void findLinesCrossPoint(Point2f origin1, Point2f dir1, Point2f origin2, Point2f dir2, Point2f& cross_point)
{ {
float det = dir2.x*dir1.y - dir2.y*dir1.x; float det = dir2.x*dir1.y - dir2.y*dir1.x;
Point2f offset = origin2 - origin1; Point2f offset = origin2 - origin1;
@ -124,30 +124,30 @@ void findLinesCrossPoint(Point2f origin1, Point2f dir1, Point2f origin2, Point2f
cross_point = origin1 + dir1*alpha; cross_point = origin1 + dir1*alpha;
} }
void findCorner(const vector<Point>& contour, Point2f point, Point2f& corner) // static void findCorner(const vector<Point>& contour, Point2f point, Point2f& corner)
{ // {
// find the nearest point // // find the nearest point
double min_dist = std::numeric_limits<double>::max(); // double min_dist = std::numeric_limits<double>::max();
int min_idx = -1; // int min_idx = -1;
// find corner idx // // find corner idx
for(size_t i = 0; i < contour.size(); i++) // for(size_t i = 0; i < contour.size(); i++)
{ // {
double dist = norm(Point2f((float)contour[i].x, (float)contour[i].y) - point); // double dist = norm(Point2f((float)contour[i].x, (float)contour[i].y) - point);
if(dist < min_dist) // if(dist < min_dist)
{ // {
min_dist = dist; // min_dist = dist;
min_idx = (int)i; // min_idx = (int)i;
} // }
} // }
assert(min_idx >= 0); // assert(min_idx >= 0);
// temporary solution, have to make something more precise // // temporary solution, have to make something more precise
corner = contour[min_idx]; // corner = contour[min_idx];
return; // return;
} // }
void findCorner(const vector<Point2f>& contour, Point2f point, Point2f& corner) static void findCorner(const vector<Point2f>& contour, Point2f point, Point2f& corner)
{ {
// find the nearest point // find the nearest point
double min_dist = std::numeric_limits<double>::max(); double min_dist = std::numeric_limits<double>::max();
@ -170,7 +170,7 @@ void findCorner(const vector<Point2f>& contour, Point2f point, Point2f& corner)
return; return;
} }
int segment_hist_max(const Mat& hist, int& low_thresh, int& high_thresh) static int segment_hist_max(const Mat& hist, int& low_thresh, int& high_thresh)
{ {
Mat bw; Mat bw;
//const double max_bell_width = 20; // we expect two bells with width bounded above //const double max_bell_width = 20; // we expect two bells with width bounded above

View File

@ -102,7 +102,7 @@ namespace cv
{ {
const int MIN_POINTS_COUNT = 4; const int MIN_POINTS_COUNT = 4;
void project3dPoints(const Mat& points, const Mat& rvec, const Mat& tvec, Mat& modif_points) static void project3dPoints(const Mat& points, const Mat& rvec, const Mat& tvec, Mat& modif_points)
{ {
modif_points.create(1, points.cols, CV_32FC3); modif_points.create(1, points.cols, CV_32FC3);
Mat R(3, 3, CV_64FC1); Mat R(3, 3, CV_64FC1);
@ -162,7 +162,7 @@ namespace cv
CameraParameters camera; CameraParameters camera;
}; };
void pnpTask(const vector<char>& pointsMask, const Mat& objectPoints, const Mat& imagePoints, static void pnpTask(const vector<char>& pointsMask, const Mat& objectPoints, const Mat& imagePoints,
const Parameters& params, vector<int>& inliers, Mat& rvec, Mat& tvec, const Parameters& params, vector<int>& inliers, Mat& rvec, Mat& tvec,
const Mat& rvecInit, const Mat& tvecInit, Mutex& resultsMutex) const Mat& rvecInit, const Mat& tvecInit, Mutex& resultsMutex)
{ {

View File

@ -730,7 +730,7 @@ void LevMarqSparse::optimize(CvMat &_vis) { //main function that runs minimizati
//Utilities //Utilities
void fjac(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, CvMat* A, CvMat* B, void* /*data*/) { static void fjac(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, CvMat* A, CvMat* B, void* /*data*/) {
//compute jacobian per camera parameters (i.e. Aij) //compute jacobian per camera parameters (i.e. Aij)
//take i-th point 3D current coordinates //take i-th point 3D current coordinates
@ -935,7 +935,7 @@ void fjac(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, CvMat* A
#endif #endif
}; };
void func(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, CvMat* estim, void* /*data*/) { static void func(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, CvMat* estim, void* /*data*/) {
//just do projections //just do projections
CvMat _Mi; CvMat _Mi;
cvReshape( point_params, &_Mi, 3, 1 ); cvReshape( point_params, &_Mi, 3, 1 );
@ -975,12 +975,12 @@ void func(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, CvMat* e
cvReleaseMat( &_mp2 ); cvReleaseMat( &_mp2 );
}; };
void fjac_new(int i, int j, Mat& point_params, Mat& cam_params, Mat& A, Mat& B, void* data) { static void fjac_new(int i, int j, Mat& point_params, Mat& cam_params, Mat& A, Mat& B, void* data) {
CvMat _point_params = point_params, _cam_params = cam_params, _Al = A, _Bl = B; CvMat _point_params = point_params, _cam_params = cam_params, _Al = A, _Bl = B;
fjac(i,j, &_point_params, &_cam_params, &_Al, &_Bl, data); fjac(i,j, &_point_params, &_cam_params, &_Al, &_Bl, data);
}; };
void func_new(int i, int j, Mat& point_params, Mat& cam_params, Mat& estim, void* data) { static void func_new(int i, int j, Mat& point_params, Mat& cam_params, Mat& estim, void* data) {
CvMat _point_params = point_params, _cam_params = cam_params, _estim = estim; CvMat _point_params = point_params, _cam_params = cam_params, _estim = estim;
func(i,j,&_point_params,&_cam_params,&_estim,data); func(i,j,&_point_params,&_cam_params,&_estim,data);
}; };

View File

@ -81,6 +81,7 @@ private:
{ {
public: public:
virtual ImageIterator* iterator() const = 0; virtual ImageIterator* iterator() const = 0;
virtual ~ImageRange() {}
}; };
// Sliding window // Sliding window

View File

@ -60,7 +60,7 @@ static Mat sortMatrixRowsByIndices(InputArray src, InputArray indices)
} }
Mat argsort(InputArray _src, bool ascending=true) static Mat argsort(InputArray _src, bool ascending=true)
{ {
Mat src = _src.getMat(); Mat src = _src.getMat();
if (src.rows != 1 && src.cols != 1) if (src.rows != 1 && src.cols != 1)

View File

@ -3,7 +3,7 @@
#define DEBUGLOGS 1 #define DEBUGLOGS 1
#if ANDROID #ifdef ANDROID
#include <android/log.h> #include <android/log.h>
#define LOG_TAG "OBJECT_DETECTOR" #define LOG_TAG "OBJECT_DETECTOR"
#define LOGD0(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)) #define LOGD0(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__))

View File

@ -46,7 +46,7 @@
using namespace cv; using namespace cv;
void downsamplePoints( const Mat& src, Mat& dst, size_t count ) static void downsamplePoints( const Mat& src, Mat& dst, size_t count )
{ {
CV_Assert( count >= 2 ); CV_Assert( count >= 2 );
CV_Assert( src.cols == 1 || src.rows == 1 ); CV_Assert( src.cols == 1 || src.rows == 1 );

View File

@ -73,7 +73,7 @@ static Mat asRowMatrix(InputArrayOfArrays src, int rtype, double alpha=1, double
return data; return data;
} }
void sortMatrixColumnsByIndices(InputArray _src, InputArray _indices, OutputArray _dst) { static void sortMatrixColumnsByIndices(InputArray _src, InputArray _indices, OutputArray _dst) {
if(_indices.getMat().type() != CV_32SC1) if(_indices.getMat().type() != CV_32SC1)
CV_Error(CV_StsUnsupportedFormat, "cv::sortColumnsByIndices only works on integer indices!"); CV_Error(CV_StsUnsupportedFormat, "cv::sortColumnsByIndices only works on integer indices!");
Mat src = _src.getMat(); Mat src = _src.getMat();
@ -87,7 +87,7 @@ void sortMatrixColumnsByIndices(InputArray _src, InputArray _indices, OutputArra
} }
} }
Mat sortMatrixColumnsByIndices(InputArray src, InputArray indices) { static Mat sortMatrixColumnsByIndices(InputArray src, InputArray indices) {
Mat dst; Mat dst;
sortMatrixColumnsByIndices(src, indices, dst); sortMatrixColumnsByIndices(src, indices, dst);
return dst; return dst;

View File

@ -43,8 +43,9 @@
#include "precomp.hpp" #include "precomp.hpp"
#include <limits> #include <limits>
namespace cv namespace
{ {
using namespace cv;
const size_t MAX_STACK_SIZE = 255; const size_t MAX_STACK_SIZE = 255;
const size_t MAX_LEAFS = 8; const size_t MAX_LEAFS = 8;
@ -159,10 +160,13 @@ namespace cv
child.x_min = parent.x_min; child.x_min = parent.x_min;
} }
}//namespace
//////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////// Octree ////////////////////////////////////// /////////////////////////// Octree //////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////
namespace cv
{
Octree::Octree() Octree::Octree()
{ {
} }

View File

@ -43,7 +43,7 @@
#ifndef __OPENCV_PRECOMP_H__ #ifndef __OPENCV_PRECOMP_H__
#define __OPENCV_PRECOMP_H__ #define __OPENCV_PRECOMP_H__
#if _MSC_VER >= 1200 #if defined _MSC_VER && _MSC_VER >= 1200
#pragma warning( disable: 4251 4710 4711 4514 4996 ) #pragma warning( disable: 4251 4710 4711 4514 4996 )
#endif #endif

View File

@ -1299,6 +1299,7 @@ public:
GPU_MAT = 9 << KIND_SHIFT GPU_MAT = 9 << KIND_SHIFT
}; };
_InputArray(); _InputArray();
_InputArray(const Mat& m); _InputArray(const Mat& m);
_InputArray(const MatExpr& expr); _InputArray(const MatExpr& expr);
template<typename _Tp> _InputArray(const _Tp* vec, int n); template<typename _Tp> _InputArray(const _Tp* vec, int n);
@ -1328,6 +1329,8 @@ public:
virtual int channels(int i=-1) const; virtual int channels(int i=-1) const;
virtual bool empty() const; virtual bool empty() const;
virtual ~_InputArray();
int flags; int flags;
void* obj; void* obj;
Size sz; Size sz;
@ -1384,6 +1387,8 @@ public:
virtual void create(int dims, const int* size, int type, int i=-1, bool allowTransposed=false, int fixedDepthMask=0) const; virtual void create(int dims, const int* size, int type, int i=-1, bool allowTransposed=false, int fixedDepthMask=0) const;
virtual void release() const; virtual void release() const;
virtual void clear() const; virtual void clear() const;
virtual ~_OutputArray();
}; };
typedef const _InputArray& InputArray; typedef const _InputArray& InputArray;

View File

@ -60,34 +60,34 @@
#endif #endif
#if defined WIN32 || defined WINCE #if defined WIN32 || defined WINCE
#ifndef _WIN32_WINNT // This is needed for the declaration of TryEnterCriticalSection in winbase.h with Visual Studio 2005 (and older?) # ifndef _WIN32_WINNT // This is needed for the declaration of TryEnterCriticalSection in winbase.h with Visual Studio 2005 (and older?)
#define _WIN32_WINNT 0x0400 // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx # define _WIN32_WINNT 0x0400 // http://msdn.microsoft.com/en-us/library/ms686857(VS.85).aspx
#endif # endif
#include <windows.h> # include <windows.h>
#undef small # undef small
#undef min # undef min
#undef max # undef max
#else #else
#include <pthread.h> # include <pthread.h>
#endif #endif
#ifdef __BORLANDC__ #ifdef __BORLANDC__
#ifndef WIN32 # ifndef WIN32
#define WIN32 # define WIN32
#endif # endif
#ifndef _WIN32 # ifndef _WIN32
#define _WIN32 # define _WIN32
#endif # endif
#define CV_DLL # define CV_DLL
#undef _CV_ALWAYS_PROFILE_ # undef _CV_ALWAYS_PROFILE_
#define _CV_ALWAYS_NO_PROFILE_ # define _CV_ALWAYS_NO_PROFILE_
#endif #endif
#ifndef FALSE #ifndef FALSE
#define FALSE 0 # define FALSE 0
#endif #endif
#ifndef TRUE #ifndef TRUE
#define TRUE 1 # define TRUE 1
#endif #endif
#define __BEGIN__ __CV_BEGIN__ #define __BEGIN__ __CV_BEGIN__
@ -95,7 +95,7 @@
#define EXIT __CV_EXIT__ #define EXIT __CV_EXIT__
#ifdef HAVE_IPP #ifdef HAVE_IPP
#include "ipp.h" # include "ipp.h"
CV_INLINE IppiSize ippiSize(int width, int height) CV_INLINE IppiSize ippiSize(int width, int height)
{ {
@ -104,69 +104,68 @@ CV_INLINE IppiSize ippiSize(int width, int height)
} }
#endif #endif
#if defined __SSE2__ || _MSC_VER >= 1300 #if defined __SSE2__ || (defined _MSC_VER && _MSC_VER >= 1300)
#include "emmintrin.h" # include "emmintrin.h"
#define CV_SSE 1 # define CV_SSE 1
#define CV_SSE2 1 # define CV_SSE2 1
#if defined __SSE3__ || _MSC_VER >= 1500 # if defined __SSE3__ || (defined _MSC_VER && _MSC_VER >= 1500)
#include "pmmintrin.h" # include "pmmintrin.h"
#define CV_SSE3 1 # define CV_SSE3 1
#endif # else
#if defined __SSSE3__ # define CV_SSE3 0
#include "tmmintrin.h" # endif
#define CV_SSSE3 1 # if defined __SSSE3__
#endif # include "tmmintrin.h"
# define CV_SSSE3 1
# else
# define CV_SSSE3 0
# endif
#else #else
#define CV_SSE 0 # define CV_SSE 0
#define CV_SSE2 0 # define CV_SSE2 0
#define CV_SSE3 0 # define CV_SSE3 0
#define CV_SSSE3 0 # define CV_SSSE3 0
#endif #endif
#if defined ANDROID && defined __ARM_NEON__ && defined __GNUC__ #if defined ANDROID && defined __ARM_NEON__
#include "arm_neon.h" # include "arm_neon.h"
#define CV_NEON 1 # define CV_NEON 1
#define CPU_HAS_NEON_FEATURE (true) # define CPU_HAS_NEON_FEATURE (true)
//TODO: make real check using stuff from "cpu-features.h" //TODO: make real check using stuff from "cpu-features.h"
//((bool)android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) //((bool)android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON)
#else #else
#define CV_NEON 0 # define CV_NEON 0
#define CPU_HAS_NEON_FEATURE (false) # define CPU_HAS_NEON_FEATURE (false)
#endif
#ifdef CV_ICC
#define CV_ENABLE_UNROLLED 0
#else
#define CV_ENABLE_UNROLLED 1
#endif #endif
#ifndef IPPI_CALL #ifndef IPPI_CALL
#define IPPI_CALL(func) CV_Assert((func) >= 0) # define IPPI_CALL(func) CV_Assert((func) >= 0)
#endif #endif
#ifdef HAVE_TBB #ifdef HAVE_TBB
#include "tbb/tbb_stddef.h" # include "tbb/tbb_stddef.h"
#if TBB_VERSION_MAJOR*100 + TBB_VERSION_MINOR >= 202 # if TBB_VERSION_MAJOR*100 + TBB_VERSION_MINOR >= 202
#include "tbb/tbb.h" # include "tbb/tbb.h"
#include "tbb/task.h" # include "tbb/task.h"
#undef min # undef min
#undef max # undef max
#else # else
#undef HAVE_TBB # undef HAVE_TBB
#endif # endif
#endif #endif
#ifdef HAVE_EIGEN #ifdef HAVE_EIGEN
#include <Eigen/Core> # include <Eigen/Core>
#include "opencv2/core/eigen.hpp" # include "opencv2/core/eigen.hpp"
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
namespace cv
{
#ifdef HAVE_TBB #ifdef HAVE_TBB
namespace cv
{
typedef tbb::blocked_range<int> BlockedRange; typedef tbb::blocked_range<int> BlockedRange;
template<typename Body> static inline template<typename Body> static inline
@ -191,10 +190,7 @@ CV_INLINE IppiSize ippiSize(int width, int height)
typedef tbb::concurrent_vector<Rect> ConcurrentRectVector; typedef tbb::concurrent_vector<Rect> ConcurrentRectVector;
typedef tbb::concurrent_vector<double> ConcurrentDoubleVector; typedef tbb::concurrent_vector<double> ConcurrentDoubleVector;
}
#else #else
namespace cv
{
class BlockedRange class BlockedRange
{ {
public: public:
@ -230,11 +226,10 @@ CV_INLINE IppiSize ippiSize(int width, int height)
{ {
body(range); body(range);
} }
}
#endif #endif
} //namespace cv
#define CV_INIT_ALGORITHM(classname, algname, memberinit) \ #define CV_INIT_ALGORITHM(classname, algname, memberinit) \
static Algorithm* create##classname() \ static Algorithm* create##classname() \
{ \ { \
return new classname; \ return new classname; \
@ -261,7 +256,7 @@ CV_INLINE IppiSize ippiSize(int width, int height)
return &classname##_info(); \ return &classname##_info(); \
} }
#endif #endif //__cplusplus
/* maximal size of vector to run matrix operations on it inline (i.e. w/o ipp calls) */ /* maximal size of vector to run matrix operations on it inline (i.e. w/o ipp calls) */
#define CV_MAX_INLINE_MAT_OP_SIZE 10 #define CV_MAX_INLINE_MAT_OP_SIZE 10
@ -305,9 +300,9 @@ CV_INLINE IppiSize ippiSize(int width, int height)
#define CV_MAX_STRLEN 1024 #define CV_MAX_STRLEN 1024
#if 0 /*def CV_CHECK_FOR_NANS*/ #if 0 /*def CV_CHECK_FOR_NANS*/
#define CV_CHECK_NANS( arr ) cvCheckArray((arr)) # define CV_CHECK_NANS( arr ) cvCheckArray((arr))
#else #else
#define CV_CHECK_NANS( arr ) # define CV_CHECK_NANS( arr )
#endif #endif
/****************************************************************************************\ /****************************************************************************************\
@ -316,38 +311,38 @@ CV_INLINE IppiSize ippiSize(int width, int height)
/* get alloca declaration */ /* get alloca declaration */
#ifdef __GNUC__ #ifdef __GNUC__
#undef alloca # undef alloca
#define alloca __builtin_alloca # define alloca __builtin_alloca
#define CV_HAVE_ALLOCA 1 # define CV_HAVE_ALLOCA 1
#elif defined WIN32 || defined _WIN32 || \ #elif defined WIN32 || defined _WIN32 || \
defined WINCE || defined _MSC_VER || defined __BORLANDC__ defined WINCE || defined _MSC_VER || defined __BORLANDC__
#include <malloc.h> # include <malloc.h>
#define CV_HAVE_ALLOCA 1 # define CV_HAVE_ALLOCA 1
#elif defined HAVE_ALLOCA_H #elif defined HAVE_ALLOCA_H
#include <alloca.h> # include <alloca.h>
#define CV_HAVE_ALLOCA 1 # define CV_HAVE_ALLOCA 1
#elif defined HAVE_ALLOCA #elif defined HAVE_ALLOCA
#include <stdlib.h> # include <stdlib.h>
#define CV_HAVE_ALLOCA 1 # define CV_HAVE_ALLOCA 1
#else #else
#undef CV_HAVE_ALLOCA # undef CV_HAVE_ALLOCA
#endif #endif
#ifdef __GNUC__ #ifdef __GNUC__
#define CV_DECL_ALIGNED(x) __attribute__ ((aligned (x))) # define CV_DECL_ALIGNED(x) __attribute__ ((aligned (x)))
#elif defined _MSC_VER #elif defined _MSC_VER
#define CV_DECL_ALIGNED(x) __declspec(align(x)) # define CV_DECL_ALIGNED(x) __declspec(align(x))
#else #else
#define CV_DECL_ALIGNED(x) # define CV_DECL_ALIGNED(x)
#endif #endif
#if CV_HAVE_ALLOCA #if CV_HAVE_ALLOCA
/* ! DO NOT make it an inline function */ /* ! DO NOT make it an inline function */
#define cvStackAlloc(size) cvAlignPtr( alloca((size) + CV_MALLOC_ALIGN), CV_MALLOC_ALIGN ) # define cvStackAlloc(size) cvAlignPtr( alloca((size) + CV_MALLOC_ALIGN), CV_MALLOC_ALIGN )
#endif #endif
#ifndef CV_IMPL #ifndef CV_IMPL
#define CV_IMPL CV_EXTERN_C # define CV_IMPL CV_EXTERN_C
#endif #endif
#define CV_DBG_BREAK() { volatile int* crashMe = 0; *crashMe = 0; } #define CV_DBG_BREAK() { volatile int* crashMe = 0; *crashMe = 0; }
@ -720,8 +715,7 @@ CvFuncTable;
typedef struct CvBigFuncTable typedef struct CvBigFuncTable
{ {
void* fn_2d[CV_DEPTH_MAX*4]; void* fn_2d[CV_DEPTH_MAX*4];
} } CvBigFuncTable;
CvBigFuncTable;
#define CV_INIT_FUNC_TAB( tab, FUNCNAME, FLAG ) \ #define CV_INIT_FUNC_TAB( tab, FUNCNAME, FLAG ) \
(tab).fn_2d[CV_8U] = (void*)FUNCNAME##_8u##FLAG; \ (tab).fn_2d[CV_8U] = (void*)FUNCNAME##_8u##FLAG; \
@ -732,6 +726,7 @@ CvBigFuncTable;
(tab).fn_2d[CV_32F] = (void*)FUNCNAME##_32f##FLAG; \ (tab).fn_2d[CV_32F] = (void*)FUNCNAME##_32f##FLAG; \
(tab).fn_2d[CV_64F] = (void*)FUNCNAME##_64f##FLAG (tab).fn_2d[CV_64F] = (void*)FUNCNAME##_64f##FLAG
#ifdef __cplusplus
//! OpenGL extension table //! OpenGL extension table
class CV_EXPORTS CvOpenGlFuncTab class CV_EXPORTS CvOpenGlFuncTab
{ {
@ -764,4 +759,6 @@ CV_EXPORTS bool icvCheckGlError(const char* file, const int line, const char* fu
#define CV_CheckGlError() CV_DbgAssert( (::icvCheckGlError(__FILE__, __LINE__)) ) #define CV_CheckGlError() CV_DbgAssert( (::icvCheckGlError(__FILE__, __LINE__)) )
#endif #endif
#endif #endif //__cplusplus
#endif // __OPENCV_CORE_INTERNAL_HPP__

View File

@ -43,122 +43,132 @@
#ifndef __OPENCV_CORE_TYPES_H__ #ifndef __OPENCV_CORE_TYPES_H__
#define __OPENCV_CORE_TYPES_H__ #define __OPENCV_CORE_TYPES_H__
#if !defined _CRT_SECURE_NO_DEPRECATE && _MSC_VER > 1300 #if !defined _CRT_SECURE_NO_DEPRECATE && defined _MSC_VER
#define _CRT_SECURE_NO_DEPRECATE /* to avoid multiple Visual Studio 2005 warnings */ # if _MSC_VER > 1300
# define _CRT_SECURE_NO_DEPRECATE /* to avoid multiple Visual Studio 2005 warnings */
# endif
#endif #endif
#ifndef SKIP_INCLUDES #ifndef SKIP_INCLUDES
#include <assert.h>
#include <stdlib.h> #include <assert.h>
#include <string.h> #include <stdlib.h>
#include <float.h> #include <string.h>
#include <float.h>
#if !defined _MSC_VER && !defined __BORLANDC__ #if !defined _MSC_VER && !defined __BORLANDC__
#include <stdint.h> # include <stdint.h>
#endif #endif
#if defined __ICL #if defined __ICL
#define CV_ICC __ICL # define CV_ICC __ICL
#elif defined __ICC #elif defined __ICC
#define CV_ICC __ICC # define CV_ICC __ICC
#elif defined __ECL #elif defined __ECL
#define CV_ICC __ECL # define CV_ICC __ECL
#elif defined __ECC #elif defined __ECC
#define CV_ICC __ECC # define CV_ICC __ECC
#elif defined __INTEL_COMPILER #elif defined __INTEL_COMPILER
#define CV_ICC __INTEL_COMPILER # define CV_ICC __INTEL_COMPILER
#endif #endif
#if (_MSC_VER >= 1400 && defined _M_X64) || (__GNUC__ >= 4 && defined __x86_64__) #if defined CV_ICC && !defined CV_ENABLE_UNROLLED
#if defined WIN32 # define CV_ENABLE_UNROLLED 0
#include <intrin.h> #else
#endif # define CV_ENABLE_UNROLLED 1
#if __SSE2__ || !defined __GNUC__ #endif
#include <emmintrin.h>
#endif
#endif
#if defined __BORLANDC__ #if (defined _M_X64 && _MSC_VER >= 1400) || (__GNUC__ >= 4 && defined __x86_64__)
#include <fastmath.h> # if defined WIN32
#else # include <intrin.h>
#include <math.h> # endif
#endif # if __SSE2__ || !defined __GNUC__
# include <emmintrin.h>
# endif
#endif
#if defined __BORLANDC__
# include <fastmath.h>
#else
# include <math.h>
#endif
#ifdef HAVE_IPL
# ifndef __IPL_H__
# if defined WIN32 || defined _WIN32
# include <ipl.h>
# else
# include <ipl/ipl.h>
# endif
# endif
#elif defined __IPL_H__
# define HAVE_IPL
#endif
#ifdef HAVE_IPL
#ifndef __IPL_H__
#if defined WIN32 || defined _WIN32
#include <ipl.h>
#else
#include <ipl/ipl.h>
#endif
#endif
#elif defined __IPL_H__
#define HAVE_IPL
#endif
#endif // SKIP_INCLUDES #endif // SKIP_INCLUDES
#if defined WIN32 || defined _WIN32 #if defined WIN32 || defined _WIN32
#define CV_CDECL __cdecl # define CV_CDECL __cdecl
#define CV_STDCALL __stdcall # define CV_STDCALL __stdcall
#else #else
#define CV_CDECL # define CV_CDECL
#define CV_STDCALL # define CV_STDCALL
#endif #endif
#ifndef CV_EXTERN_C #ifndef CV_EXTERN_C
#ifdef __cplusplus # ifdef __cplusplus
#define CV_EXTERN_C extern "C" # define CV_EXTERN_C extern "C"
#define CV_DEFAULT(val) = val # define CV_DEFAULT(val) = val
#else # else
#define CV_EXTERN_C # define CV_EXTERN_C
#define CV_DEFAULT(val) # define CV_DEFAULT(val)
#endif # endif
#endif #endif
#ifndef CV_EXTERN_C_FUNCPTR #ifndef CV_EXTERN_C_FUNCPTR
#ifdef __cplusplus # ifdef __cplusplus
#define CV_EXTERN_C_FUNCPTR(x) extern "C" { typedef x; } # define CV_EXTERN_C_FUNCPTR(x) extern "C" { typedef x; }
#else # else
#define CV_EXTERN_C_FUNCPTR(x) typedef x # define CV_EXTERN_C_FUNCPTR(x) typedef x
#endif # endif
#endif #endif
#ifndef CV_INLINE #ifndef CV_INLINE
#if defined __cplusplus # if defined __cplusplus
#define CV_INLINE inline # define CV_INLINE inline
#elif (defined WIN32 || defined _WIN32 || defined WINCE) && !defined __GNUC__ # elif (defined WIN32 || defined _WIN32 || defined WINCE) && !defined __GNUC__
#define CV_INLINE __inline # define CV_INLINE __inline
#else # else
#define CV_INLINE static # define CV_INLINE static
#endif # endif
#endif /* CV_INLINE */ #endif /* CV_INLINE */
#if (defined WIN32 || defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS #if (defined WIN32 || defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS
#define CV_EXPORTS __declspec(dllexport) # define CV_EXPORTS __declspec(dllexport)
#else #else
#define CV_EXPORTS # define CV_EXPORTS
#endif #endif
#ifndef CVAPI #ifndef CVAPI
#define CVAPI(rettype) CV_EXTERN_C CV_EXPORTS rettype CV_CDECL # define CVAPI(rettype) CV_EXTERN_C CV_EXPORTS rettype CV_CDECL
#endif #endif
#if defined _MSC_VER || defined __BORLANDC__ #if defined _MSC_VER || defined __BORLANDC__
typedef __int64 int64; typedef __int64 int64;
typedef unsigned __int64 uint64; typedef unsigned __int64 uint64;
#define CV_BIG_INT(n) n##I64 # define CV_BIG_INT(n) n##I64
#define CV_BIG_UINT(n) n##UI64 # define CV_BIG_UINT(n) n##UI64
#else #else
typedef int64_t int64; typedef int64_t int64;
typedef uint64_t uint64; typedef uint64_t uint64;
#define CV_BIG_INT(n) n##LL # define CV_BIG_INT(n) n##LL
#define CV_BIG_UINT(n) n##ULL # define CV_BIG_UINT(n) n##ULL
#endif #endif
#ifndef HAVE_IPL #ifndef HAVE_IPL
typedef unsigned char uchar; typedef unsigned char uchar;
typedef unsigned short ushort; typedef unsigned short ushort;
#endif #endif
typedef signed char schar; typedef signed char schar;
@ -271,11 +281,11 @@ enum {
#define CV_SWAP(a,b,t) ((t) = (a), (a) = (b), (b) = (t)) #define CV_SWAP(a,b,t) ((t) = (a), (a) = (b), (b) = (t))
#ifndef MIN #ifndef MIN
#define MIN(a,b) ((a) > (b) ? (b) : (a)) # define MIN(a,b) ((a) > (b) ? (b) : (a))
#endif #endif
#ifndef MAX #ifndef MAX
#define MAX(a,b) ((a) < (b) ? (b) : (a)) # define MAX(a,b) ((a) < (b) ? (b) : (a))
#endif #endif
/* min & max without jumps */ /* min & max without jumps */
@ -285,9 +295,9 @@ enum {
/* absolute value without jumps */ /* absolute value without jumps */
#ifndef __cplusplus #ifndef __cplusplus
#define CV_IABS(a) (((a) ^ ((a) < 0 ? -1 : 0)) - ((a) < 0 ? -1 : 0)) # define CV_IABS(a) (((a) ^ ((a) < 0 ? -1 : 0)) - ((a) < 0 ? -1 : 0))
#else #else
#define CV_IABS(a) abs(a) # define CV_IABS(a) abs(a)
#endif #endif
#define CV_CMP(a,b) (((a) > (b)) - ((a) < (b))) #define CV_CMP(a,b) (((a) > (b)) - ((a) < (b)))
#define CV_SIGN(a) CV_CMP((a),0) #define CV_SIGN(a) CV_CMP((a),0)
@ -318,7 +328,7 @@ CV_INLINE int cvRound( double value )
} }
#if defined __SSE2__ || (defined _M_IX86_FP && 2 == _M_IX86_FP) #if defined __SSE2__ || (defined _M_IX86_FP && 2 == _M_IX86_FP)
#include "emmintrin.h" # include "emmintrin.h"
#endif #endif
CV_INLINE int cvFloor( double value ) CV_INLINE int cvFloor( double value )
@ -1886,6 +1896,6 @@ typedef struct CvModuleInfo
} }
CvModuleInfo; CvModuleInfo;
#endif /*_CXCORE_TYPES_H_*/ #endif /*__OPENCV_CORE_TYPES_H__*/
/* End of file. */ /* End of file. */

View File

@ -3,7 +3,7 @@
#include "opencv2/ts/ts.hpp" #include "opencv2/ts/ts.hpp"
#if GTEST_CREATE_SHARED_LIBRARY #ifdef GTEST_CREATE_SHARED_LIBRARY
#error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined #error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined
#endif #endif

View File

@ -55,7 +55,9 @@ static void* OutOfMemoryError(size_t size)
#if CV_USE_SYSTEM_MALLOC #if CV_USE_SYSTEM_MALLOC
#if defined WIN32 || defined _WIN32
void deleteThreadAllocData() {} void deleteThreadAllocData() {}
#endif
void* fastMalloc( size_t size ) void* fastMalloc( size_t size )
{ {

View File

@ -974,7 +974,7 @@ void convertAndUnrollScalar( const Mat& sc, int buftype, uchar* scbuf, size_t bl
scbuf[i] = scbuf[i - esz]; scbuf[i] = scbuf[i - esz];
} }
void binary_op(InputArray _src1, InputArray _src2, OutputArray _dst, static void binary_op(InputArray _src1, InputArray _src2, OutputArray _dst,
InputArray _mask, const BinaryFunc* tab, bool bitwise) InputArray _mask, const BinaryFunc* tab, bool bitwise)
{ {
int kind1 = _src1.kind(), kind2 = _src2.kind(); int kind1 = _src1.kind(), kind2 = _src2.kind();
@ -1216,7 +1216,7 @@ void cv::min(const Mat& src1, double src2, Mat& dst)
namespace cv namespace cv
{ {
void arithm_op(InputArray _src1, InputArray _src2, OutputArray _dst, static void arithm_op(InputArray _src1, InputArray _src2, OutputArray _dst,
InputArray _mask, int dtype, BinaryFunc* tab, bool muldiv=false, void* usrdata=0) InputArray _mask, int dtype, BinaryFunc* tab, bool muldiv=false, void* usrdata=0)
{ {
int kind1 = _src1.kind(), kind2 = _src2.kind(); int kind1 = _src1.kind(), kind2 = _src2.kind();

View File

@ -6,6 +6,7 @@
using namespace std; using namespace std;
using namespace cv; using namespace cv;
namespace {
void helpParser() void helpParser()
{ {
printf("\nThe CommandLineParser class is designed for command line arguments parsing\n" printf("\nThe CommandLineParser class is designed for command line arguments parsing\n"
@ -89,6 +90,8 @@ string del_space(string name)
return name; return name;
} }
}//namespace
CommandLineParser::CommandLineParser(int argc, const char* const argv[], const char* keys) CommandLineParser::CommandLineParser(int argc, const char* const argv[], const char* keys)
{ {
std::string keys_buffer; std::string keys_buffer;

View File

@ -1845,37 +1845,37 @@ iPow_( const T* src, T* dst, int len, int power )
} }
void iPow8u(const uchar* src, uchar* dst, int len, int power) static void iPow8u(const uchar* src, uchar* dst, int len, int power)
{ {
iPow_<uchar, int>(src, dst, len, power); iPow_<uchar, int>(src, dst, len, power);
} }
void iPow8s(const schar* src, schar* dst, int len, int power) static void iPow8s(const schar* src, schar* dst, int len, int power)
{ {
iPow_<schar, int>(src, dst, len, power); iPow_<schar, int>(src, dst, len, power);
} }
void iPow16u(const ushort* src, ushort* dst, int len, int power) static void iPow16u(const ushort* src, ushort* dst, int len, int power)
{ {
iPow_<ushort, int>(src, dst, len, power); iPow_<ushort, int>(src, dst, len, power);
} }
void iPow16s(const short* src, short* dst, int len, int power) static void iPow16s(const short* src, short* dst, int len, int power)
{ {
iPow_<short, int>(src, dst, len, power); iPow_<short, int>(src, dst, len, power);
} }
void iPow32s(const int* src, int* dst, int len, int power) static void iPow32s(const int* src, int* dst, int len, int power)
{ {
iPow_<int, int>(src, dst, len, power); iPow_<int, int>(src, dst, len, power);
} }
void iPow32f(const float* src, float* dst, int len, int power) static void iPow32f(const float* src, float* dst, int len, int power)
{ {
iPow_<float, float>(src, dst, len, power); iPow_<float, float>(src, dst, len, power);
} }
void iPow64f(const double* src, double* dst, int len, int power) static void iPow64f(const double* src, double* dst, int len, int power)
{ {
iPow_<double, double>(src, dst, len, power); iPow_<double, double>(src, dst, len, power);
} }

View File

@ -917,6 +917,7 @@ void scalarToRawData(const Scalar& s, void* _buf, int type, int unroll_to)
\*************************************************************************************************/ \*************************************************************************************************/
_InputArray::_InputArray() : flags(0), obj(0) {} _InputArray::_InputArray() : flags(0), obj(0) {}
_InputArray::~_InputArray() {}
_InputArray::_InputArray(const Mat& m) : flags(MAT), obj((void*)&m) {} _InputArray::_InputArray(const Mat& m) : flags(MAT), obj((void*)&m) {}
_InputArray::_InputArray(const vector<Mat>& vec) : flags(STD_VECTOR_MAT), obj((void*)&vec) {} _InputArray::_InputArray(const vector<Mat>& vec) : flags(STD_VECTOR_MAT), obj((void*)&vec) {}
_InputArray::_InputArray(const double& val) : flags(FIXED_TYPE + FIXED_SIZE + MATX + CV_64F), obj((void*)&val), sz(Size(1,1)) {} _InputArray::_InputArray(const double& val) : flags(FIXED_TYPE + FIXED_SIZE + MATX + CV_64F), obj((void*)&val), sz(Size(1,1)) {}
@ -1280,6 +1281,7 @@ bool _InputArray::empty() const
_OutputArray::_OutputArray() {} _OutputArray::_OutputArray() {}
_OutputArray::~_OutputArray() {}
_OutputArray::_OutputArray(Mat& m) : _InputArray(m) {} _OutputArray::_OutputArray(Mat& m) : _InputArray(m) {}
_OutputArray::_OutputArray(vector<Mat>& vec) : _InputArray(vec) {} _OutputArray::_OutputArray(vector<Mat>& vec) : _InputArray(vec) {}
@ -3260,7 +3262,7 @@ convertScaleData_(const void* _from, void* _to, int cn, double alpha, double bet
to[i] = saturate_cast<T2>(from[i]*alpha + beta); to[i] = saturate_cast<T2>(from[i]*alpha + beta);
} }
ConvertData getConvertData(int fromType, int toType) static ConvertData getConvertData(int fromType, int toType)
{ {
static ConvertData tab[][8] = static ConvertData tab[][8] =
{{ convertData_<uchar, uchar>, convertData_<uchar, schar>, {{ convertData_<uchar, uchar>, convertData_<uchar, schar>,
@ -3305,7 +3307,7 @@ ConvertData getConvertData(int fromType, int toType)
return func; return func;
} }
ConvertScaleData getConvertScaleData(int fromType, int toType) static ConvertScaleData getConvertScaleData(int fromType, int toType)
{ {
static ConvertScaleData tab[][8] = static ConvertScaleData tab[][8] =
{{ convertScaleData_<uchar, uchar>, convertScaleData_<uchar, schar>, {{ convertScaleData_<uchar, uchar>, convertScaleData_<uchar, schar>,

View File

@ -243,7 +243,7 @@ static CFormatter cFormatter;
static const Formatter* g_defaultFormatter0 = &matlabFormatter; static const Formatter* g_defaultFormatter0 = &matlabFormatter;
static const Formatter* g_defaultFormatter = &matlabFormatter; static const Formatter* g_defaultFormatter = &matlabFormatter;
bool my_streq(const char* a, const char* b) static bool my_streq(const char* a, const char* b)
{ {
size_t i, alen = strlen(a), blen = strlen(b); size_t i, alen = strlen(a), blen = strlen(b);
if( alen != blen ) if( alen != blen )

View File

@ -962,7 +962,7 @@ static const uchar popCountTable4[] =
1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
}; };
int normHamming(const uchar* a, int n) static int normHamming(const uchar* a, int n)
{ {
int i = 0, result = 0; int i = 0, result = 0;
#if CV_NEON #if CV_NEON
@ -1020,7 +1020,7 @@ int normHamming(const uchar* a, const uchar* b, int n)
return result; return result;
} }
int normHamming(const uchar* a, int n, int cellSize) static int normHamming(const uchar* a, int n, int cellSize)
{ {
if( cellSize == 1 ) if( cellSize == 1 )
return normHamming(a, n); return normHamming(a, n);

View File

@ -374,7 +374,7 @@ int getThreadNum(void)
#endif #endif
} }
#if ANDROID #ifdef ANDROID
static inline int getNumberOfCPUsImpl() static inline int getNumberOfCPUsImpl()
{ {
FILE* cpuPossible = fopen("/sys/devices/system/cpu/possible", "r"); FILE* cpuPossible = fopen("/sys/devices/system/cpu/possible", "r");
@ -421,7 +421,7 @@ int getNumberOfCPUs(void)
GetSystemInfo( &sysinfo ); GetSystemInfo( &sysinfo );
return (int)sysinfo.dwNumberOfProcessors; return (int)sysinfo.dwNumberOfProcessors;
#elif ANDROID #elif defined ANDROID
static int ncpus = getNumberOfCPUsImpl(); static int ncpus = getNumberOfCPUsImpl();
printf("CPUS= %d\n", ncpus); printf("CPUS= %d\n", ncpus);
return ncpus; return ncpus;
@ -475,7 +475,7 @@ string tempfile( const char* suffix )
{ {
char buf[L_tmpnam]; char buf[L_tmpnam];
char* name = 0; char* name = 0;
#if ANDROID #ifdef ANDROID
strcpy(buf, "/sdcard/__opencv_temp_XXXXXX"); strcpy(buf, "/sdcard/__opencv_temp_XXXXXX");
name = mktemp(buf); name = mktemp(buf);
#else #else

View File

@ -2023,12 +2023,12 @@ void Core_GraphScanTest::run( int )
event = "End of procedure"; event = "End of procedure";
break; break;
default: default:
#if _MSC_VER >= 1200 #if defined _MSC_VER && _MSC_VER >= 1200
#pragma warning( push ) #pragma warning( push )
#pragma warning( disable : 4127 ) #pragma warning( disable : 4127 )
#endif #endif
CV_TS_SEQ_CHECK_CONDITION( 0, "Invalid code appeared during graph scan" ); CV_TS_SEQ_CHECK_CONDITION( 0, "Invalid code appeared during graph scan" );
#if _MSC_VER >= 1200 #if defined _MSC_VER && _MSC_VER >= 1200
#pragma warning( pop ) #pragma warning( pop )
#endif #endif
} }

View File

@ -5,7 +5,7 @@
#include "opencv2/highgui/highgui.hpp" #include "opencv2/highgui/highgui.hpp"
#include "opencv2/features2d/features2d.hpp" #include "opencv2/features2d/features2d.hpp"
#if GTEST_CREATE_SHARED_LIBRARY #ifdef GTEST_CREATE_SHARED_LIBRARY
#error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined #error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined
#endif #endif

View File

@ -61,7 +61,7 @@ inline int smoothedSum(const Mat& sum, const KeyPoint& pt, int y, int x)
+ sum.at<int>(img_y - HALF_KERNEL, img_x - HALF_KERNEL); + sum.at<int>(img_y - HALF_KERNEL, img_x - HALF_KERNEL);
} }
void pixelTests16(const Mat& sum, const std::vector<KeyPoint>& keypoints, Mat& descriptors) static void pixelTests16(const Mat& sum, const std::vector<KeyPoint>& keypoints, Mat& descriptors)
{ {
for (int i = 0; i < (int)keypoints.size(); ++i) for (int i = 0; i < (int)keypoints.size(); ++i)
{ {
@ -71,7 +71,7 @@ void pixelTests16(const Mat& sum, const std::vector<KeyPoint>& keypoints, Mat& d
} }
} }
void pixelTests32(const Mat& sum, const std::vector<KeyPoint>& keypoints, Mat& descriptors) static void pixelTests32(const Mat& sum, const std::vector<KeyPoint>& keypoints, Mat& descriptors)
{ {
for (int i = 0; i < (int)keypoints.size(); ++i) for (int i = 0; i < (int)keypoints.size(); ++i)
{ {
@ -82,7 +82,7 @@ void pixelTests32(const Mat& sum, const std::vector<KeyPoint>& keypoints, Mat& d
} }
} }
void pixelTests64(const Mat& sum, const std::vector<KeyPoint>& keypoints, Mat& descriptors) static void pixelTests64(const Mat& sum, const std::vector<KeyPoint>& keypoints, Mat& descriptors)
{ {
for (int i = 0; i < (int)keypoints.size(); ++i) for (int i = 0; i < (int)keypoints.size(); ++i)
{ {

View File

@ -117,7 +117,7 @@ OpponentColorDescriptorExtractor::OpponentColorDescriptorExtractor( const Ptr<De
CV_Assert( !descriptorExtractor.empty() ); CV_Assert( !descriptorExtractor.empty() );
} }
void convertBGRImageToOpponentColorSpace( const Mat& bgrImage, vector<Mat>& opponentChannels ) static void convertBGRImageToOpponentColorSpace( const Mat& bgrImage, vector<Mat>& opponentChannels )
{ {
if( bgrImage.type() != CV_8UC3 ) if( bgrImage.type() != CV_8UC3 )
CV_Error( CV_StsBadArg, "input image must be an BGR image of type CV_8UC3" ); CV_Error( CV_StsBadArg, "input image must be an BGR image of type CV_8UC3" );

View File

@ -203,7 +203,7 @@ struct ResponseComparator
} }
}; };
void keepStrongest( int N, vector<KeyPoint>& keypoints ) static void keepStrongest( int N, vector<KeyPoint>& keypoints )
{ {
if( (int)keypoints.size() > N ) if( (int)keypoints.size() > N )
{ {

View File

@ -42,8 +42,7 @@
#include "precomp.hpp" #include "precomp.hpp"
namespace cv using namespace cv;
{
/////////////////////// AlgorithmInfo for various detector & descriptors //////////////////////////// /////////////////////// AlgorithmInfo for various detector & descriptors ////////////////////////////
@ -134,22 +133,23 @@ CV_INIT_ALGORITHM(DenseFeatureDetector, "Feature2D.Dense",
obj.info()->addParam(obj, "varyImgBoundWithScale", obj.varyImgBoundWithScale)); obj.info()->addParam(obj, "varyImgBoundWithScale", obj.varyImgBoundWithScale));
CV_INIT_ALGORITHM(GridAdaptedFeatureDetector, "Feature2D.Grid", CV_INIT_ALGORITHM(GridAdaptedFeatureDetector, "Feature2D.Grid",
obj.info()->addParam(obj, "detector", (Ptr<Algorithm>&)obj.detector); //obj.info()->addParam(obj, "detector", (Ptr<Algorithm>&)obj.detector);
obj.info()->addParam(obj, "maxTotalKeypoints", obj.maxTotalKeypoints); obj.info()->addParam(obj, "maxTotalKeypoints", obj.maxTotalKeypoints);
obj.info()->addParam(obj, "gridRows", obj.gridRows); obj.info()->addParam(obj, "gridRows", obj.gridRows);
obj.info()->addParam(obj, "gridCols", obj.gridCols)); obj.info()->addParam(obj, "gridCols", obj.gridCols));
bool initModule_features2d(void) bool cv::initModule_features2d(void)
{ {
Ptr<Algorithm> brief = createBriefDescriptorExtractor(), orb = createORB(), bool all = true;
star = createStarDetector(), fastd = createFastFeatureDetector(), mser = createMSER(), all &= !BriefDescriptorExtractor_info_auto.name().empty();
dense = createDenseFeatureDetector(), gftt = createGFTTDetector(), all &= !FastFeatureDetector_info_auto.name().empty();
harris = createHarrisDetector(), grid = createGridAdaptedFeatureDetector(); all &= !StarDetector_info_auto.name().empty();
all &= !MSER_info_auto.name().empty();
all &= !ORB_info_auto.name().empty();
all &= !GFTTDetector_info_auto.name().empty();
all &= !HarrisDetector_info_auto.name().empty();
all &= !DenseFeatureDetector_info_auto.name().empty();
all &= !GridAdaptedFeatureDetector_info_auto.name().empty();
return brief->info() != 0 && orb->info() != 0 && star->info() != 0 && return all;
fastd->info() != 0 && mser->info() != 0 && dense->info() != 0 &&
gftt->info() != 0 && harris->info() != 0 && grid->info() != 0;
} }
}

View File

@ -174,7 +174,7 @@ int DescriptorMatcher::DescriptorCollection::size() const
/* /*
* DescriptorMatcher * DescriptorMatcher
*/ */
void convertMatches( const vector<vector<DMatch> >& knnMatches, vector<DMatch>& matches ) static void convertMatches( const vector<vector<DMatch> >& knnMatches, vector<DMatch>& matches )
{ {
matches.clear(); matches.clear();
matches.reserve( knnMatches.size() ); matches.reserve( knnMatches.size() );

View File

@ -43,7 +43,7 @@
#ifndef __OPENCV_PRECOMP_H__ #ifndef __OPENCV_PRECOMP_H__
#define __OPENCV_PRECOMP_H__ #define __OPENCV_PRECOMP_H__
#if _MSC_VER >= 1200 #if defined _MSC_VER && _MSC_VER >= 1200
#pragma warning( disable: 4251 4512 4710 4711 4514 4996 ) #pragma warning( disable: 4251 4512 4710 4711 4514 4996 )
#endif #endif

View File

@ -493,23 +493,6 @@ private:
CV_DescriptorExtractorTest& operator=(const CV_DescriptorExtractorTest&) { return *this; } CV_DescriptorExtractorTest& operator=(const CV_DescriptorExtractorTest&) { return *this; }
}; };
/*template<typename T, typename Distance>
class CV_CalonderDescriptorExtractorTest : public CV_DescriptorExtractorTest<Distance>
{
public:
CV_CalonderDescriptorExtractorTest( const char* testName, float _normDif, float _prevTime ) :
CV_DescriptorExtractorTest<Distance>( testName, _normDif, Ptr<DescriptorExtractor>(), _prevTime )
{}
protected:
virtual void createDescriptorExtractor()
{
CV_DescriptorExtractorTest<Distance>::dextractor =
new CalonderDescriptorExtractor<T>( string(CV_DescriptorExtractorTest<Distance>::ts->get_data_path()) +
FEATURES2D_DIR + "/calonder_classifier.rtc");
}
};*/
/****************************************************************************************\ /****************************************************************************************\
* Algorithmic tests for descriptor matchers * * Algorithmic tests for descriptor matchers *
\****************************************************************************************/ \****************************************************************************************/
@ -1059,24 +1042,6 @@ TEST( Features2d_DescriptorExtractor_BRIEF, regression )
test.safe_run(); test.safe_run();
} }
#if CV_SSE2
TEST( Features2d_DescriptorExtractor_Calonder_uchar, regression )
{
CV_CalonderDescriptorExtractorTest<uchar, L2<uchar> > test( "descriptor-calonder-uchar",
std::numeric_limits<float>::epsilon() + 1,
0.0132175f );
test.safe_run();
}
TEST( Features2d_DescriptorExtractor_Calonder_float, regression )
{
CV_CalonderDescriptorExtractorTest<float, L2<float> > test( "descriptor-calonder-float",
std::numeric_limits<float>::epsilon(),
0.0221308f );
test.safe_run();
}
#endif // CV_SSE2
/* /*
* Matchers * Matchers
*/ */

View File

@ -46,6 +46,7 @@ struct base_any_policy
virtual ::size_t get_size() = 0; virtual ::size_t get_size() = 0;
virtual const std::type_info& type() = 0; virtual const std::type_info& type() = 0;
virtual void print(std::ostream& out, void* const* src) = 0; virtual void print(std::ostream& out, void* const* src) = 0;
virtual ~base_any_policy() {}
}; };
template<typename T> template<typename T>

View File

@ -35,6 +35,9 @@
#ifndef OPENCV_FLANN_DYNAMIC_BITSET_H_ #ifndef OPENCV_FLANN_DYNAMIC_BITSET_H_
#define OPENCV_FLANN_DYNAMIC_BITSET_H_ #define OPENCV_FLANN_DYNAMIC_BITSET_H_
#ifndef FLANN_USE_BOOST
# define FLANN_USE_BOOST 0
#endif
//#define FLANN_USE_BOOST 1 //#define FLANN_USE_BOOST 1
#if FLANN_USE_BOOST #if FLANN_USE_BOOST
#include <boost/dynamic_bitset.hpp> #include <boost/dynamic_bitset.hpp>

View File

@ -40,6 +40,11 @@
#include <iomanip> #include <iomanip>
#include <limits.h> #include <limits.h>
// TODO as soon as we use C++0x, use the code in USE_UNORDERED_MAP // TODO as soon as we use C++0x, use the code in USE_UNORDERED_MAP
#ifdef __GXX_EXPERIMENTAL_CXX0X__
# define USE_UNORDERED_MAP 1
#else
# define USE_UNORDERED_MAP 0
#endif
#if USE_UNORDERED_MAP #if USE_UNORDERED_MAP
#include <unordered_map> #include <unordered_map>
#else #else

View File

@ -16,7 +16,7 @@
#include "perf_utility.hpp" #include "perf_utility.hpp"
#if GTEST_CREATE_SHARED_LIBRARY #ifdef GTEST_CREATE_SHARED_LIBRARY
#error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined #error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined
#endif #endif

View File

@ -20,7 +20,7 @@
#include "perf_utility.hpp" #include "perf_utility.hpp"
#if GTEST_CREATE_SHARED_LIBRARY #ifdef GTEST_CREATE_SHARED_LIBRARY
#error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined #error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined
#endif #endif

View File

@ -43,7 +43,7 @@
#ifndef __OPENCV_PRECOMP_H__ #ifndef __OPENCV_PRECOMP_H__
#define __OPENCV_PRECOMP_H__ #define __OPENCV_PRECOMP_H__
#if _MSC_VER >= 1200 #if defined _MSC_VER && _MSC_VER >= 1200
#pragma warning( disable: 4251 4710 4711 4514 4996 ) #pragma warning( disable: 4251 4710 4711 4514 4996 )
#endif #endif

View File

@ -81,6 +81,10 @@ if(HAVE_QT)
list(APPEND HIGHGUI_LIBRARIES ${QT_LIBRARIES} ${QT_QTTEST_LIBRARY}) list(APPEND HIGHGUI_LIBRARIES ${QT_LIBRARIES} ${QT_QTTEST_LIBRARY})
list(APPEND highgui_srcs src/window_QT.cpp ${_MOC_OUTFILES} ${_RCC_OUTFILES} ) list(APPEND highgui_srcs src/window_QT.cpp ${_MOC_OUTFILES} ${_RCC_OUTFILES} )
if(CMAKE_COMPILER_IS_GNUCXX)
set_source_files_properties(${_RCC_OUTFILES} PROPERTIES COMPILE_FLAGS "-Wno-missing-declarations")
endif()
elseif(WIN32) elseif(WIN32)
list(APPEND highgui_srcs src/window_w32.cpp) list(APPEND highgui_srcs src/window_w32.cpp)
elseif(HAVE_GTK) elseif(HAVE_GTK)
@ -131,6 +135,10 @@ if(HAVE_OPENNI)
list(APPEND highgui_srcs src/cap_openni.cpp) list(APPEND highgui_srcs src/cap_openni.cpp)
ocv_include_directories(${OPENNI_INCLUDE_DIR}) ocv_include_directories(${OPENNI_INCLUDE_DIR})
list(APPEND HIGHGUI_LIBRARIES ${OPENNI_LIBRARY}) list(APPEND HIGHGUI_LIBRARIES ${OPENNI_LIBRARY})
if(CMAKE_COMPILER_IS_GNUCXX)
set_source_files_properties(src/cap_openni.cpp PROPERTIES COMPILE_FLAGS "-Wno-unknown-pragmas -Wno-uninitialized -Wno-reorder -Wno-strict-aliasing")
endif()
endif(HAVE_OPENNI) endif(HAVE_OPENNI)
if(HAVE_opencv_androidcamera) if(HAVE_opencv_androidcamera)

View File

@ -79,7 +79,7 @@ CVAPI(void) cvDisplayStatusBar(const char* name, const char* text, int delayms C
CVAPI(void) cvSaveWindowParameters(const char* name); CVAPI(void) cvSaveWindowParameters(const char* name);
CVAPI(void) cvLoadWindowParameters(const char* name); CVAPI(void) cvLoadWindowParameters(const char* name);
CVAPI(int) cvStartLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[]); CVAPI(int) cvStartLoop(int (*pt2Func)(int argc, char *argv[]), int argc, char* argv[]);
CVAPI(void) cvStopLoop(); CVAPI(void) cvStopLoop( void );
typedef void (CV_CDECL *CvButtonCallback)(int state, void* userdata); typedef void (CV_CDECL *CvButtonCallback)(int state, void* userdata);
enum {CV_PUSH_BUTTON = 0, CV_CHECKBOX = 1, CV_RADIOBOX = 2}; enum {CV_PUSH_BUTTON = 0, CV_CHECKBOX = 1, CV_RADIOBOX = 2};
@ -90,7 +90,7 @@ CVAPI(int) cvCreateButton( const char* button_name CV_DEFAULT(NULL),CvButtonCall
/* this function is used to set some external parameters in case of X Window */ /* this function is used to set some external parameters in case of X Window */
CVAPI(int) cvInitSystem( int argc, char** argv ); CVAPI(int) cvInitSystem( int argc, char** argv );
CVAPI(int) cvStartWindowThread(); CVAPI(int) cvStartWindowThread( void );
// --------- YV --------- // --------- YV ---------
enum enum

View File

@ -4,7 +4,7 @@
#include "opencv2/ts/ts.hpp" #include "opencv2/ts/ts.hpp"
#include "opencv2/highgui/highgui.hpp" #include "opencv2/highgui/highgui.hpp"
#if GTEST_CREATE_SHARED_LIBRARY #ifdef GTEST_CREATE_SHARED_LIBRARY
#error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined #error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined
#endif #endif

View File

@ -41,7 +41,7 @@
#include "precomp.hpp" #include "precomp.hpp"
#if _MSC_VER >= 1200 #if defined _MSC_VER && _MSC_VER >= 1200
#pragma warning( disable: 4711 ) #pragma warning( disable: 4711 )
#endif #endif

View File

@ -140,7 +140,7 @@ extern "C" {
#define AV_NOPTS_VALUE_ ((int64_t)AV_NOPTS_VALUE) #define AV_NOPTS_VALUE_ ((int64_t)AV_NOPTS_VALUE)
#endif #endif
int get_number_of_cpus(void) static int get_number_of_cpus(void)
{ {
#if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(52, 111, 0) #if LIBAVFORMAT_BUILD < CALC_FFMPEG_VERSION(52, 111, 0)
return 1; return 1;
@ -1010,7 +1010,7 @@ static AVStream *icv_add_video_stream_FFMPEG(AVFormatContext *oc,
static const int OPENCV_NO_FRAMES_WRITTEN_CODE = 1000; static const int OPENCV_NO_FRAMES_WRITTEN_CODE = 1000;
int icv_av_write_frame_FFMPEG( AVFormatContext * oc, AVStream * video_st, uint8_t * outbuf, uint32_t outbuf_size, AVFrame * picture ) static int icv_av_write_frame_FFMPEG( AVFormatContext * oc, AVStream * video_st, uint8_t * outbuf, uint32_t outbuf_size, AVFrame * picture )
{ {
#if LIBAVFORMAT_BUILD > 4628 #if LIBAVFORMAT_BUILD > 4628
AVCodecContext * c = video_st->codec; AVCodecContext * c = video_st->codec;

View File

@ -50,6 +50,20 @@
#include <iostream> #include <iostream>
#include <queue> #include <queue>
#ifndef i386
# define i386 0
#endif
#ifndef __arm__
# define __arm__ 0
#endif
#ifndef _ARC
# define _ARC 0
#endif
#ifndef __APPLE__
# define __APPLE__ 0
#endif
#include "XnCppWrapper.h" #include "XnCppWrapper.h"
const std::string XMLConfig = const std::string XMLConfig =
@ -169,6 +183,8 @@ private:
approxSyncGrabber(approxSyncGrabber), isDepthFilled(false), isImageFilled(false) approxSyncGrabber(approxSyncGrabber), isDepthFilled(false), isImageFilled(false)
{} {}
virtual ~ApproximateSynchronizerBase() {}
virtual bool isSpinContinue() const = 0; virtual bool isSpinContinue() const = 0;
virtual void pushDepthMetaData( xn::DepthMetaData& depthMetaData ) = 0; virtual void pushDepthMetaData( xn::DepthMetaData& depthMetaData ) = 0;
virtual void pushImageMetaData( xn::ImageMetaData& imageMetaData ) = 0; virtual void pushImageMetaData( xn::ImageMetaData& imageMetaData ) = 0;
@ -508,14 +524,14 @@ bool CvCapture_OpenNI::isOpened() const
return isContextOpened; return isContextOpened;
} }
XnMapOutputMode defaultMapOutputMode() // static XnMapOutputMode defaultMapOutputMode()
{ // {
XnMapOutputMode mode; // XnMapOutputMode mode;
mode.nXRes = XN_VGA_X_RES; // mode.nXRes = XN_VGA_X_RES;
mode.nYRes = XN_VGA_Y_RES; // mode.nYRes = XN_VGA_Y_RES;
mode.nFPS = 30; // mode.nFPS = 30;
return mode; // return mode;
} // }
CvCapture_OpenNI::CvCapture_OpenNI( int index ) CvCapture_OpenNI::CvCapture_OpenNI( int index )
@ -1201,7 +1217,7 @@ IplImage* CvCapture_OpenNI::retrievePointCloudMap()
return outputMaps[CV_CAP_OPENNI_POINT_CLOUD_MAP].getIplImagePtr(); return outputMaps[CV_CAP_OPENNI_POINT_CLOUD_MAP].getIplImagePtr();
} }
void computeDisparity_32F( const xn::DepthMetaData& depthMetaData, cv::Mat& disp, XnDouble baseline, XnUInt64 F, static void computeDisparity_32F( const xn::DepthMetaData& depthMetaData, cv::Mat& disp, XnDouble baseline, XnUInt64 F,
XnUInt64 noSampleValue, XnUInt64 shadowValue ) XnUInt64 noSampleValue, XnUInt64 shadowValue )
{ {
cv::Mat depth; cv::Mat depth;

View File

@ -126,8 +126,7 @@ skip_input_data(j_decompress_ptr cinfo, long num_bytes)
} }
GLOBAL(void) static void jpeg_buffer_src(j_decompress_ptr cinfo, JpegSource* source)
jpeg_buffer_src(j_decompress_ptr cinfo, JpegSource* source)
{ {
cinfo->src = &source->pub; cinfo->src = &source->pub;
@ -498,8 +497,7 @@ empty_output_buffer (j_compress_ptr cinfo)
return TRUE; return TRUE;
} }
GLOBAL(void) static void jpeg_buffer_dest(j_compress_ptr cinfo, JpegDestination* destination)
jpeg_buffer_dest(j_compress_ptr cinfo, JpegDestination* destination)
{ {
cinfo->dest = &destination->pub; cinfo->dest = &destination->pub;

View File

@ -57,7 +57,7 @@ namespace cv
static vector<ImageDecoder> decoders; static vector<ImageDecoder> decoders;
static vector<ImageEncoder> encoders; static vector<ImageEncoder> encoders;
ImageDecoder findDecoder( const string& filename ) static ImageDecoder findDecoder( const string& filename )
{ {
size_t i, maxlen = 0; size_t i, maxlen = 0;
for( i = 0; i < decoders.size(); i++ ) for( i = 0; i < decoders.size(); i++ )
@ -83,7 +83,7 @@ ImageDecoder findDecoder( const string& filename )
return ImageDecoder(); return ImageDecoder();
} }
ImageDecoder findDecoder( const Mat& buf ) static ImageDecoder findDecoder( const Mat& buf )
{ {
size_t i, maxlen = 0; size_t i, maxlen = 0;
@ -110,7 +110,7 @@ ImageDecoder findDecoder( const Mat& buf )
return ImageDecoder(); return ImageDecoder();
} }
ImageEncoder findEncoder( const string& _ext ) static ImageEncoder findEncoder( const string& _ext )
{ {
if( _ext.size() <= 1 ) if( _ext.size() <= 1 )
return ImageEncoder(); return ImageEncoder();

View File

@ -42,7 +42,7 @@
#ifndef __HIGHGUI_H_ #ifndef __HIGHGUI_H_
#define __HIGHGUI_H_ #define __HIGHGUI_H_
#if _MSC_VER >= 1200 #if defined _MSC_VER && _MSC_VER >= 1200
#pragma warning( disable: 4251 ) #pragma warning( disable: 4251 )
#endif #endif

View File

@ -349,7 +349,7 @@ CV_IMPL void cvStopLoop()
} }
CvWindow* icvFindWindowByName(QString name) static CvWindow* icvFindWindowByName(QString name)
{ {
CvWindow* window = 0; CvWindow* window = 0;
@ -377,7 +377,7 @@ CvWindow* icvFindWindowByName(QString name)
} }
CvBar* icvFindBarByName(QBoxLayout* layout, QString name_bar, typeBar type) static CvBar* icvFindBarByName(QBoxLayout* layout, QString name_bar, typeBar type)
{ {
if (!layout) if (!layout)
return NULL; return NULL;
@ -396,7 +396,7 @@ CvBar* icvFindBarByName(QBoxLayout* layout, QString name_bar, typeBar type)
} }
CvTrackbar* icvFindTrackBarByName(const char* name_trackbar, const char* name_window, QBoxLayout* layout = NULL) static CvTrackbar* icvFindTrackBarByName(const char* name_trackbar, const char* name_window, QBoxLayout* layout = NULL)
{ {
QString nameQt(name_trackbar); QString nameQt(name_trackbar);
@ -432,15 +432,15 @@ CvTrackbar* icvFindTrackBarByName(const char* name_trackbar, const char* name_wi
} }
} }
/*
CvButtonbar* icvFindButtonBarByName(const char* button_name, QBoxLayout* layout) static CvButtonbar* icvFindButtonBarByName(const char* button_name, QBoxLayout* layout)
{ {
QString nameQt(button_name); QString nameQt(button_name);
return (CvButtonbar*) icvFindBarByName(layout, nameQt, type_CvButtonbar); return (CvButtonbar*) icvFindBarByName(layout, nameQt, type_CvButtonbar);
} }
*/
static int icvInitSystem(int* c, char** v)
int icvInitSystem(int* c, char** v)
{ {
//"For any GUI application using Qt, there is precisely one QApplication object" //"For any GUI application using Qt, there is precisely one QApplication object"
if (!QApplication::instance()) if (!QApplication::instance())

View File

@ -1372,17 +1372,17 @@ cvDestroyAllWindows( void )
CV_UNLOCK_MUTEX(); CV_UNLOCK_MUTEX();
} }
CvSize icvCalcOptimalWindowSize( CvWindow * window, CvSize new_image_size){ // CvSize icvCalcOptimalWindowSize( CvWindow * window, CvSize new_image_size){
CvSize window_size; // CvSize window_size;
GtkWidget * toplevel = gtk_widget_get_toplevel( window->frame ); // GtkWidget * toplevel = gtk_widget_get_toplevel( window->frame );
gdk_drawable_get_size( GDK_DRAWABLE(toplevel->window), // gdk_drawable_get_size( GDK_DRAWABLE(toplevel->window),
&window_size.width, &window_size.height ); // &window_size.width, &window_size.height );
window_size.width = window_size.width + new_image_size.width - window->widget->allocation.width; // window_size.width = window_size.width + new_image_size.width - window->widget->allocation.width;
window_size.height = window_size.height + new_image_size.height - window->widget->allocation.height; // window_size.height = window_size.height + new_image_size.height - window->widget->allocation.height;
return window_size; // return window_size;
} // }
CV_IMPL void CV_IMPL void
cvShowImage( const char* name, const CvArr* arr ) cvShowImage( const char* name, const CvArr* arr )

View File

@ -5,7 +5,7 @@
#include "opencv2/imgproc/imgproc.hpp" #include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/highgui/highgui.hpp" #include "opencv2/highgui/highgui.hpp"
#if GTEST_CREATE_SHARED_LIBRARY #ifdef GTEST_CREATE_SHARED_LIBRARY
#error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined #error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined
#endif #endif

View File

@ -98,6 +98,7 @@ typedef struct _list _CVLIST;
_LIST_INLINE CVPOS prefix##get_tail_pos_##type(_CVLIST*);\ _LIST_INLINE CVPOS prefix##get_tail_pos_##type(_CVLIST*);\
_LIST_INLINE type* prefix##get_next_##type(CVPOS*);\ _LIST_INLINE type* prefix##get_next_##type(CVPOS*);\
_LIST_INLINE type* prefix##get_prev_##type(CVPOS*);\ _LIST_INLINE type* prefix##get_prev_##type(CVPOS*);\
_LIST_INLINE int prefix##is_pos_##type(CVPOS pos);\
/* Modification functions*/\ /* Modification functions*/\
_LIST_INLINE void prefix##clear_list_##type(_CVLIST*);\ _LIST_INLINE void prefix##clear_list_##type(_CVLIST*);\
_LIST_INLINE CVPOS prefix##add_head_##type(_CVLIST*, type*);\ _LIST_INLINE CVPOS prefix##add_head_##type(_CVLIST*, type*);\

View File

@ -233,7 +233,7 @@ typedef DiffC3<cv::Vec3i> Diff32sC3;
typedef DiffC1<float> Diff32fC1; typedef DiffC1<float> Diff32fC1;
typedef DiffC3<cv::Vec3f> Diff32fC3; typedef DiffC3<cv::Vec3f> Diff32fC3;
cv::Vec3i& operator += (cv::Vec3i& a, const cv::Vec3b& b) static cv::Vec3i& operator += (cv::Vec3i& a, const cv::Vec3b& b)
{ {
a[0] += b[0]; a[0] += b[0];
a[1] += b[1]; a[1] += b[1];

View File

@ -230,7 +230,7 @@ void GMM::calcInverseCovAndDeterm( int ci )
Calculate beta - parameter of GrabCut algorithm. Calculate beta - parameter of GrabCut algorithm.
beta = 1/(2*avg(sqr(||color[i] - color[j]||))) beta = 1/(2*avg(sqr(||color[i] - color[j]||)))
*/ */
double calcBeta( const Mat& img ) static double calcBeta( const Mat& img )
{ {
double beta = 0; double beta = 0;
for( int y = 0; y < img.rows; y++ ) for( int y = 0; y < img.rows; y++ )
@ -272,7 +272,7 @@ double calcBeta( const Mat& img )
Calculate weights of noterminal vertices of graph. Calculate weights of noterminal vertices of graph.
beta and gamma - parameters of GrabCut algorithm. beta and gamma - parameters of GrabCut algorithm.
*/ */
void calcNWeights( const Mat& img, Mat& leftW, Mat& upleftW, Mat& upW, Mat& uprightW, double beta, double gamma ) static void calcNWeights( const Mat& img, Mat& leftW, Mat& upleftW, Mat& upW, Mat& uprightW, double beta, double gamma )
{ {
const double gammaDivSqrt2 = gamma / std::sqrt(2.0f); const double gammaDivSqrt2 = gamma / std::sqrt(2.0f);
leftW.create( img.rows, img.cols, CV_64FC1 ); leftW.create( img.rows, img.cols, CV_64FC1 );
@ -319,7 +319,7 @@ void calcNWeights( const Mat& img, Mat& leftW, Mat& upleftW, Mat& upW, Mat& upri
/* /*
Check size, type and element values of mask matrix. Check size, type and element values of mask matrix.
*/ */
void checkMask( const Mat& img, const Mat& mask ) static void checkMask( const Mat& img, const Mat& mask )
{ {
if( mask.empty() ) if( mask.empty() )
CV_Error( CV_StsBadArg, "mask is empty" ); CV_Error( CV_StsBadArg, "mask is empty" );
@ -342,7 +342,7 @@ void checkMask( const Mat& img, const Mat& mask )
/* /*
Initialize mask using rectangular. Initialize mask using rectangular.
*/ */
void initMaskWithRect( Mat& mask, Size imgSize, Rect rect ) static void initMaskWithRect( Mat& mask, Size imgSize, Rect rect )
{ {
mask.create( imgSize, CV_8UC1 ); mask.create( imgSize, CV_8UC1 );
mask.setTo( GC_BGD ); mask.setTo( GC_BGD );
@ -358,7 +358,7 @@ void initMaskWithRect( Mat& mask, Size imgSize, Rect rect )
/* /*
Initialize GMM background and foreground models using kmeans algorithm. Initialize GMM background and foreground models using kmeans algorithm.
*/ */
void initGMMs( const Mat& img, const Mat& mask, GMM& bgdGMM, GMM& fgdGMM ) static void initGMMs( const Mat& img, const Mat& mask, GMM& bgdGMM, GMM& fgdGMM )
{ {
const int kMeansItCount = 10; const int kMeansItCount = 10;
const int kMeansType = KMEANS_PP_CENTERS; const int kMeansType = KMEANS_PP_CENTERS;
@ -398,7 +398,7 @@ void initGMMs( const Mat& img, const Mat& mask, GMM& bgdGMM, GMM& fgdGMM )
/* /*
Assign GMMs components for each pixel. Assign GMMs components for each pixel.
*/ */
void assignGMMsComponents( const Mat& img, const Mat& mask, const GMM& bgdGMM, const GMM& fgdGMM, Mat& compIdxs ) static void assignGMMsComponents( const Mat& img, const Mat& mask, const GMM& bgdGMM, const GMM& fgdGMM, Mat& compIdxs )
{ {
Point p; Point p;
for( p.y = 0; p.y < img.rows; p.y++ ) for( p.y = 0; p.y < img.rows; p.y++ )
@ -415,7 +415,7 @@ void assignGMMsComponents( const Mat& img, const Mat& mask, const GMM& bgdGMM, c
/* /*
Learn GMMs parameters. Learn GMMs parameters.
*/ */
void learnGMMs( const Mat& img, const Mat& mask, const Mat& compIdxs, GMM& bgdGMM, GMM& fgdGMM ) static void learnGMMs( const Mat& img, const Mat& mask, const Mat& compIdxs, GMM& bgdGMM, GMM& fgdGMM )
{ {
bgdGMM.initLearning(); bgdGMM.initLearning();
fgdGMM.initLearning(); fgdGMM.initLearning();
@ -443,7 +443,7 @@ void learnGMMs( const Mat& img, const Mat& mask, const Mat& compIdxs, GMM& bgdGM
/* /*
Construct GCGraph Construct GCGraph
*/ */
void constructGCGraph( const Mat& img, const Mat& mask, const GMM& bgdGMM, const GMM& fgdGMM, double lambda, static void constructGCGraph( const Mat& img, const Mat& mask, const GMM& bgdGMM, const GMM& fgdGMM, double lambda,
const Mat& leftW, const Mat& upleftW, const Mat& upW, const Mat& uprightW, const Mat& leftW, const Mat& upleftW, const Mat& upW, const Mat& uprightW,
GCGraph<double>& graph ) GCGraph<double>& graph )
{ {
@ -506,7 +506,7 @@ void constructGCGraph( const Mat& img, const Mat& mask, const GMM& bgdGMM, const
/* /*
Estimate segmentation using MaxFlow algorithm Estimate segmentation using MaxFlow algorithm
*/ */
void estimateSegmentation( GCGraph<double>& graph, Mat& mask ) static void estimateSegmentation( GCGraph<double>& graph, Mat& mask )
{ {
graph.maxFlow(); graph.maxFlow();
Point p; Point p;

View File

@ -406,7 +406,7 @@ static void fftShift(InputOutputArray _out)
merge(planes, out); merge(planes, out);
} }
Point2d weightedCentroid(InputArray _src, cv::Point peakLocation, cv::Size weightBoxSize) static Point2d weightedCentroid(InputArray _src, cv::Point peakLocation, cv::Size weightBoxSize)
{ {
Mat src = _src.getMat(); Mat src = _src.getMat();

View File

@ -454,7 +454,7 @@ void cv::GaussianBlur( InputArray _src, OutputArray _dst, Size ksize,
namespace cv namespace cv
{ {
#if _MSC_VER >= 1200 #if defined _MSC_VER && _MSC_VER >= 1200
#pragma warning( disable: 4244 ) #pragma warning( disable: 4244 )
#endif #endif
@ -734,7 +734,7 @@ medianBlur_8u_O1( const Mat& _src, Mat& _dst, int ksize )
} }
#if _MSC_VER >= 1200 #if defined _MSC_VER && _MSC_VER >= 1200
#pragma warning( default: 4244 ) #pragma warning( default: 4244 )
#endif #endif

View File

@ -207,7 +207,7 @@ void integral_( const T* src, size_t _srcstep, ST* sum, size_t _sumstep,
#define DEF_INTEGRAL_FUNC(suffix, T, ST, QT) \ #define DEF_INTEGRAL_FUNC(suffix, T, ST, QT) \
void integral_##suffix( T* src, size_t srcstep, ST* sum, size_t sumstep, QT* sqsum, size_t sqsumstep, \ static void integral_##suffix( T* src, size_t srcstep, ST* sum, size_t sumstep, QT* sqsum, size_t sqsumstep, \
ST* tilted, size_t tiltedstep, Size size, int cn ) \ ST* tilted, size_t tiltedstep, Size size, int cn ) \
{ integral_(src, srcstep, sum, sumstep, sqsum, sqsumstep, tilted, tiltedstep, size, cn); } { integral_(src, srcstep, sum, sumstep, sqsum, sqsumstep, tilted, tiltedstep, size, cn); }

View File

@ -49,7 +49,7 @@
#include "opencv2/core/core_c.h" #include "opencv2/core/core_c.h"
#include <stdio.h> #include <stdio.h>
#if _MSC_VER >= 1200 || defined __BORLANDC__ #if (defined _MSC_VER && _MSC_VER >= 1200) || defined __BORLANDC__
#define cv_stricmp stricmp #define cv_stricmp stricmp
#define cv_strnicmp strnicmp #define cv_strnicmp strnicmp
#if defined WINCE #if defined WINCE

View File

@ -3478,7 +3478,7 @@ typedef struct CvBGCodeBookModel
CvBGCodeBookElem* freeList; CvBGCodeBookElem* freeList;
} CvBGCodeBookModel; } CvBGCodeBookModel;
CVAPI(CvBGCodeBookModel*) cvCreateBGCodeBookModel(); CVAPI(CvBGCodeBookModel*) cvCreateBGCodeBookModel( void );
CVAPI(void) cvReleaseBGCodeBookModel( CvBGCodeBookModel** model ); CVAPI(void) cvReleaseBGCodeBookModel( CvBGCodeBookModel** model );
CVAPI(void) cvBGCodeBookUpdate( CvBGCodeBookModel* model, const CvArr* image, CVAPI(void) cvBGCodeBookUpdate( CvBGCodeBookModel* model, const CvArr* image,

View File

@ -41,7 +41,7 @@
#include "precomp.hpp" #include "precomp.hpp"
#if _MSC_VER >= 1200 #if defined _MSC_VER && _MSC_VER >= 1200
#pragma warning(disable:4786) // Disable MSVC warnings in the standard library. #pragma warning(disable:4786) // Disable MSVC warnings in the standard library.
#pragma warning(disable:4100) #pragma warning(disable:4100)
#pragma warning(disable:4512) #pragma warning(disable:4512)
@ -49,7 +49,7 @@
#include <stdio.h> #include <stdio.h>
#include <map> #include <map>
#include <algorithm> #include <algorithm>
#if _MSC_VER >= 1200 #if defined _MSC_VER && _MSC_VER >= 1200
#pragma warning(default:4100) #pragma warning(default:4100)
#pragma warning(default:4512) #pragma warning(default:4512)
#endif #endif

View File

@ -53,7 +53,7 @@
#include "assert.h" #include "assert.h"
#include "math.h" #include "math.h"
#if _MSC_VER >= 1400 #if defined _MSC_VER && _MSC_VER >= 1400
#pragma warning(disable: 4512) // suppress "assignment operator could not be generated" #pragma warning(disable: 4512) // suppress "assignment operator could not be generated"
#endif #endif

View File

@ -237,9 +237,9 @@ public:
virtual float* GetFVVar(){return m_FVVar;}; /* returned pointer to array of maximal values of FV, if return 0 then FVrange is not exist */ virtual float* GetFVVar(){return m_FVVar;}; /* returned pointer to array of maximal values of FV, if return 0 then FVrange is not exist */
};/* CvBlobTrackFVGenN */ };/* CvBlobTrackFVGenN */
CvBlobTrackFVGen* cvCreateFVGenP(){return (CvBlobTrackFVGen*)new CvBlobTrackFVGenN(2);} inline CvBlobTrackFVGen* cvCreateFVGenP(){return (CvBlobTrackFVGen*)new CvBlobTrackFVGenN(2);}
CvBlobTrackFVGen* cvCreateFVGenPV(){return (CvBlobTrackFVGen*)new CvBlobTrackFVGenN(4);} inline CvBlobTrackFVGen* cvCreateFVGenPV(){return (CvBlobTrackFVGen*)new CvBlobTrackFVGenN(4);}
CvBlobTrackFVGen* cvCreateFVGenPVS(){return (CvBlobTrackFVGen*)new CvBlobTrackFVGenN(5);} inline CvBlobTrackFVGen* cvCreateFVGenPVS(){return (CvBlobTrackFVGen*)new CvBlobTrackFVGenN(5);}
#undef MAX_FV_SIZE #undef MAX_FV_SIZE
#define MAX_FV_SIZE 4 #define MAX_FV_SIZE 4
@ -408,7 +408,7 @@ public:
virtual float* GetFVVar(){return m_FVVar;}; /* returned pointer to array of maximal values of FV, if return 0 then FVrange is not exist */ virtual float* GetFVVar(){return m_FVVar;}; /* returned pointer to array of maximal values of FV, if return 0 then FVrange is not exist */
};/* CvBlobTrackFVGenSS */ };/* CvBlobTrackFVGenSS */
CvBlobTrackFVGen* cvCreateFVGenSS(){return (CvBlobTrackFVGen*)new CvBlobTrackFVGenSS;} inline CvBlobTrackFVGen* cvCreateFVGenSS(){return (CvBlobTrackFVGen*)new CvBlobTrackFVGenSS;}
/*======================= TRAJECTORY ANALYZER MODULES =====================*/ /*======================= TRAJECTORY ANALYZER MODULES =====================*/
/* Trajectory Analyser module */ /* Trajectory Analyser module */
@ -1510,7 +1510,7 @@ public:
}; /* CvBlobTrackAnalysisSVM. */ }; /* CvBlobTrackAnalysisSVM. */
#if 0
CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisSVMP() CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisSVMP()
{return (CvBlobTrackAnalysis*) new CvBlobTrackAnalysisSVM(cvCreateFVGenP);} {return (CvBlobTrackAnalysis*) new CvBlobTrackAnalysisSVM(cvCreateFVGenP);}
@ -1522,3 +1522,4 @@ CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisSVMPVS()
CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisSVMSS() CvBlobTrackAnalysis* cvCreateModuleBlobTrackAnalysisSVMSS()
{return (CvBlobTrackAnalysis*) new CvBlobTrackAnalysisSVM(cvCreateFVGenSS);} {return (CvBlobTrackAnalysis*) new CvBlobTrackAnalysisSVM(cvCreateFVGenSS);}
#endif

View File

@ -162,12 +162,15 @@ public:
} }
}; /* class CvBlobTrackerOneKalman */ }; /* class CvBlobTrackerOneKalman */
#if 0
static CvBlobTrackerOne* cvCreateModuleBlobTrackerOneKalman() static CvBlobTrackerOne* cvCreateModuleBlobTrackerOneKalman()
{ {
return (CvBlobTrackerOne*) new CvBlobTrackerOneKalman; return (CvBlobTrackerOne*) new CvBlobTrackerOneKalman;
} }
CvBlobTracker* cvCreateBlobTrackerKalman() CvBlobTracker* cvCreateBlobTrackerKalman()
{ {
return cvCreateBlobTrackerList(cvCreateModuleBlobTrackerOneKalman); return cvCreateBlobTrackerList(cvCreateModuleBlobTrackerOneKalman);
} }
#endif

View File

@ -716,7 +716,7 @@ void CvBlobTrackerOneMSFG::CollectHist(IplImage* pImg, IplImage* pMask, CvBlob*
}; /* CollectHist */ }; /* CollectHist */
#endif #endif
CvBlobTrackerOne* cvCreateBlobTrackerOneMSFG() static CvBlobTrackerOne* cvCreateBlobTrackerOneMSFG()
{ {
return (CvBlobTrackerOne*) new CvBlobTrackerOneMSFG; return (CvBlobTrackerOne*) new CvBlobTrackerOneMSFG;
} }
@ -739,7 +739,7 @@ public:
}; };
}; };
CvBlobTrackerOne* cvCreateBlobTrackerOneMS() static CvBlobTrackerOne* cvCreateBlobTrackerOneMS()
{ {
return (CvBlobTrackerOne*) new CvBlobTrackerOneMS; return (CvBlobTrackerOne*) new CvBlobTrackerOneMS;
} }
@ -1169,6 +1169,7 @@ public:
}; /* CvBlobTrackerOneMSPF */ }; /* CvBlobTrackerOneMSPF */
CvBlobTrackerOne* cvCreateBlobTrackerOneMSPF();
CvBlobTrackerOne* cvCreateBlobTrackerOneMSPF() CvBlobTrackerOne* cvCreateBlobTrackerOneMSPF()
{ {
return (CvBlobTrackerOne*) new CvBlobTrackerOneMSPF; return (CvBlobTrackerOne*) new CvBlobTrackerOneMSPF;

View File

@ -47,7 +47,7 @@ typedef float DefHistType;
#define DefHistTypeMat CV_32F #define DefHistTypeMat CV_32F
#define HIST_INDEX(_pData) (((_pData)[0]>>m_ByteShift) + (((_pData)[1]>>(m_ByteShift))<<m_BinBit)+((pImgData[2]>>m_ByteShift)<<(m_BinBit*2))) #define HIST_INDEX(_pData) (((_pData)[0]>>m_ByteShift) + (((_pData)[1]>>(m_ByteShift))<<m_BinBit)+((pImgData[2]>>m_ByteShift)<<(m_BinBit*2)))
void calcKernelEpanechnikov(CvMat* pK) static void calcKernelEpanechnikov(CvMat* pK)
{ /* Allocate kernel for histogramm creation: */ { /* Allocate kernel for histogramm creation: */
int x,y; int x,y;
int w = pK->width; int w = pK->width;
@ -445,7 +445,7 @@ public:
virtual void Release(){delete this;}; virtual void Release(){delete this;};
}; /*CvBlobTrackerOneMSFGS*/ }; /*CvBlobTrackerOneMSFGS*/
CvBlobTrackerOne* cvCreateBlobTrackerOneMSFGS() static CvBlobTrackerOne* cvCreateBlobTrackerOneMSFGS()
{ {
return (CvBlobTrackerOne*) new CvBlobTrackerOneMSFGS; return (CvBlobTrackerOne*) new CvBlobTrackerOneMSFGS;
} }

View File

@ -188,7 +188,7 @@ void CvBlobTrackPostProcKalman::Release()
delete this; delete this;
} }
CvBlobTrackPostProcOne* cvCreateModuleBlobTrackPostProcKalmanOne() static CvBlobTrackPostProcOne* cvCreateModuleBlobTrackPostProcKalmanOne()
{ {
return (CvBlobTrackPostProcOne*) new CvBlobTrackPostProcKalman; return (CvBlobTrackPostProcOne*) new CvBlobTrackPostProcKalman;
} }

View File

@ -106,12 +106,12 @@ public:
} }
}; /* class CvBlobTrackPostProcTimeAver */ }; /* class CvBlobTrackPostProcTimeAver */
CvBlobTrackPostProcOne* cvCreateModuleBlobTrackPostProcTimeAverRectOne() static CvBlobTrackPostProcOne* cvCreateModuleBlobTrackPostProcTimeAverRectOne()
{ {
return (CvBlobTrackPostProcOne*) new CvBlobTrackPostProcTimeAver(0); return (CvBlobTrackPostProcOne*) new CvBlobTrackPostProcTimeAver(0);
} }
CvBlobTrackPostProcOne* cvCreateModuleBlobTrackPostProcTimeAverExpOne() static CvBlobTrackPostProcOne* cvCreateModuleBlobTrackPostProcTimeAverExpOne()
{ {
return (CvBlobTrackPostProcOne*) new CvBlobTrackPostProcTimeAver(1); return (CvBlobTrackPostProcOne*) new CvBlobTrackPostProcTimeAver(1);
} }

View File

@ -44,7 +44,7 @@
#undef quad #undef quad
#if _MSC_VER >= 1200 #if defined _MSC_VER && _MSC_VER >= 1200
#pragma warning( disable: 4701 ) #pragma warning( disable: 4701 )
#endif #endif

View File

@ -45,7 +45,7 @@
//#include <limits.h> //#include <limits.h>
//#include "cv.h" //#include "cv.h"
//#include "highgui.h" //#include "highgui.h"
#if 0
#include <stdio.h> #include <stdio.h>
/* Valery Mosyagin */ /* Valery Mosyagin */
@ -53,7 +53,7 @@
/* ===== Function for find corresponding between images ===== */ /* ===== Function for find corresponding between images ===== */
/* Create feature points on image and return number of them. Array points fills by found points */ /* Create feature points on image and return number of them. Array points fills by found points */
int icvCreateFeaturePoints(IplImage *image, CvMat *points, CvMat *status) static int icvCreateFeaturePoints(IplImage *image, CvMat *points, CvMat *status)
{ {
int foundFeaturePoints = 0; int foundFeaturePoints = 0;
IplImage *grayImage = 0; IplImage *grayImage = 0;
@ -175,7 +175,7 @@ int icvCreateFeaturePoints(IplImage *image, CvMat *points, CvMat *status)
/* For given points1 (with pntStatus) on image1 finds corresponding points2 on image2 and set pntStatus2 for them */ /* For given points1 (with pntStatus) on image1 finds corresponding points2 on image2 and set pntStatus2 for them */
/* Returns number of corresponding points */ /* Returns number of corresponding points */
int icvFindCorrForGivenPoints( IplImage *image1,/* Image 1 */ static int icvFindCorrForGivenPoints( IplImage *image1,/* Image 1 */
IplImage *image2,/* Image 2 */ IplImage *image2,/* Image 2 */
CvMat *points1, CvMat *points1,
CvMat *pntStatus1, CvMat *pntStatus1,
@ -435,8 +435,9 @@ int icvFindCorrForGivenPoints( IplImage *image1,/* Image 1 */
return resNumCorrPoints; return resNumCorrPoints;
} }
/*-------------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------------*/
int icvGrowPointsAndStatus(CvMat **oldPoints,CvMat **oldStatus,CvMat *addPoints,CvMat *addStatus,int addCreateNum) static int icvGrowPointsAndStatus(CvMat **oldPoints,CvMat **oldStatus,CvMat *addPoints,CvMat *addStatus,int addCreateNum)
{ {
/* Add to existing points and status arrays new points or just grow */ /* Add to existing points and status arrays new points or just grow */
CvMat *newOldPoint = 0; CvMat *newOldPoint = 0;
@ -546,8 +547,9 @@ int icvGrowPointsAndStatus(CvMat **oldPoints,CvMat **oldStatus,CvMat *addPoints,
return newTotalNumber; return newTotalNumber;
} }
/*-------------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------------*/
int icvRemoveDoublePoins( CvMat *oldPoints,/* Points on prev image */ static int icvRemoveDoublePoins( CvMat *oldPoints,/* Points on prev image */
CvMat *newPoints,/* New points */ CvMat *newPoints,/* New points */
CvMat *oldStatus,/* Status for old points */ CvMat *oldStatus,/* Status for old points */
CvMat *newStatus, CvMat *newStatus,
@ -755,7 +757,7 @@ int icvRemoveDoublePoins( CvMat *oldPoints,/* Points on prev image */
void icvComputeProjectMatrix(CvMat* objPoints,CvMat* projPoints,CvMat* projMatr); void icvComputeProjectMatrix(CvMat* objPoints,CvMat* projPoints,CvMat* projMatr);
/*-------------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------------*/
void icvComputeProjectMatrixStatus(CvMat *objPoints4D,CvMat *points2,CvMat *status, CvMat *projMatr) static void icvComputeProjectMatrixStatus(CvMat *objPoints4D,CvMat *points2,CvMat *status, CvMat *projMatr)
{ {
/* Compute number of good points */ /* Compute number of good points */
int num = cvCountNonZero(status); int num = cvCountNonZero(status);
@ -829,8 +831,7 @@ void icvComputeProjectMatrixStatus(CvMat *objPoints4D,CvMat *points2,CvMat *stat
*/ */
static void icvAddNewImageToPrevious____(
void icvAddNewImageToPrevious____(
IplImage *newImage,//Image to add IplImage *newImage,//Image to add
IplImage *oldImage,//Previous image IplImage *oldImage,//Previous image
CvMat *oldPoints,// previous 2D points on prev image (some points may be not visible) CvMat *oldPoints,// previous 2D points on prev image (some points may be not visible)
@ -947,7 +948,7 @@ void icvAddNewImageToPrevious____(
//CreateGood //CreateGood
/*-------------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------------*/
int icvDeleteSparsInPoints( int numImages, static int icvDeleteSparsInPoints( int numImages,
CvMat **points, CvMat **points,
CvMat **status, CvMat **status,
CvMat *wasStatus)/* status of previous configuration */ CvMat *wasStatus)/* status of previous configuration */
@ -1041,7 +1042,7 @@ int icvDeleteSparsInPoints( int numImages,
return comNumber; return comNumber;
} }
#if 0
/*-------------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------------*/
void icvGrowPointsArray(CvMat **points) void icvGrowPointsArray(CvMat **points)
{ {

View File

@ -79,7 +79,7 @@ typedef struct _CvRightImData
#define CV_IMAX3(a,b,c) ((temp3 = (a) >= (b) ? (a) : (b)),(temp3 >= (c) ? temp3 : (c))) #define CV_IMAX3(a,b,c) ((temp3 = (a) >= (b) ? (a) : (b)),(temp3 >= (c) ? temp3 : (c)))
#define CV_IMIN3(a,b,c) ((temp3 = (a) <= (b) ? (a) : (b)),(temp3 <= (c) ? temp3 : (c))) #define CV_IMIN3(a,b,c) ((temp3 = (a) <= (b) ? (a) : (b)),(temp3 <= (c) ? temp3 : (c)))
void icvFindStereoCorrespondenceByBirchfieldDP( uchar* src1, uchar* src2, static void icvFindStereoCorrespondenceByBirchfieldDP( uchar* src1, uchar* src2,
uchar* disparities, uchar* disparities,
CvSize size, int widthStep, CvSize size, int widthStep,
int maxDisparity, int maxDisparity,

View File

@ -41,7 +41,7 @@
#include "precomp.hpp" #include "precomp.hpp"
CvStatus CV_STDCALL static CvStatus
icvJacobiEigens_32f(float *A, float *V, float *E, int n, float eps) icvJacobiEigens_32f(float *A, float *V, float *E, int n, float eps)
{ {
int i, j, k, ind; int i, j, k, ind;

View File

@ -83,7 +83,7 @@ static int CompareContour(const void* a, const void* b, void* )
return (dx < wt && dy < ht); return (dx < wt && dy < ht);
} }
void cvFindBlobsByCCClasters(IplImage* pFG, CvBlobSeq* pBlobs, CvMemStorage* storage) static void cvFindBlobsByCCClasters(IplImage* pFG, CvBlobSeq* pBlobs, CvMemStorage* storage)
{ /* Create contours: */ { /* Create contours: */
IplImage* pIB = NULL; IplImage* pIB = NULL;
CvSeq* cnt = NULL; CvSeq* cnt = NULL;

View File

@ -160,9 +160,5 @@ public:
}; };
/* Blob detector constructor: */ /* Blob detector constructor: */
CvBlobDetector* cvCreateBlobDetectorReal(CvTestSeq* pTestSeq){return new CvBlobDetectorReal(pTestSeq);} //CvBlobDetector* cvCreateBlobDetectorReal(CvTestSeq* pTestSeq){return new CvBlobDetectorReal(pTestSeq);}

View File

@ -190,7 +190,7 @@ int icvConvertPointSystem(CvPoint3D64d M2,
return CV_NO_ERR; return CV_NO_ERR;
} }
/*--------------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------------*/
int icvComputeCoeffForStereoV3( double quad1[4][2], static int icvComputeCoeffForStereoV3( double quad1[4][2],
double quad2[4][2], double quad2[4][2],
int numScanlines, int numScanlines,
CvMatr64d camMatr1, CvMatr64d camMatr1,
@ -246,7 +246,7 @@ int icvComputeCoeffForStereoV3( double quad1[4][2],
return CV_NO_ERR; return CV_NO_ERR;
} }
/*--------------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------------*/
int icvComputeCoeffForStereoNew( double quad1[4][2], static int icvComputeCoeffForStereoNew( double quad1[4][2],
double quad2[4][2], double quad2[4][2],
int numScanlines, int numScanlines,
CvMatr32f camMatr1, CvMatr32f camMatr1,
@ -782,7 +782,7 @@ void icvGetCoefForPiece( CvPoint2D64d p_start,CvPoint2D64d p_end,
/*---------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------*/
/* Get common area of rectifying */ /* Get common area of rectifying */
void icvGetCommonArea( CvSize imageSize, static void icvGetCommonArea( CvSize imageSize,
CvPoint3D64d epipole1,CvPoint3D64d epipole2, CvPoint3D64d epipole1,CvPoint3D64d epipole2,
CvMatr64d fundMatr, CvMatr64d fundMatr,
CvVect64d coeff11,CvVect64d coeff12, CvVect64d coeff11,CvVect64d coeff12,
@ -1660,7 +1660,7 @@ void icvGetQuadsTransform(
/*---------------------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------------------*/
void icvGetQuadsTransformNew( CvSize imageSize, static void icvGetQuadsTransformNew( CvSize imageSize,
CvMatr32f camMatr1, CvMatr32f camMatr1,
CvMatr32f camMatr2, CvMatr32f camMatr2,
CvMatr32f rotMatr1, CvMatr32f rotMatr1,
@ -2127,7 +2127,7 @@ CV_IMPL IplImage* icvCreateIsometricImage( IplImage* src, IplImage* dst,
return dst; return dst;
} }
int static int
icvCvt_32f_64d( float *src, double *dst, int size ) icvCvt_32f_64d( float *src, double *dst, int size )
{ {
int t; int t;
@ -2147,7 +2147,7 @@ icvCvt_32f_64d( float *src, double *dst, int size )
/*======================================================================================*/ /*======================================================================================*/
/* Type conversion double -> float */ /* Type conversion double -> float */
int static int
icvCvt_64d_32f( double *src, float *dst, int size ) icvCvt_64d_32f( double *src, float *dst, int size )
{ {
int t; int t;
@ -2167,9 +2167,9 @@ icvCvt_64d_32f( double *src, float *dst, int size )
/*----------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------*/
#if 0
/* Find line which cross frame by line(a,b,c) */ /* Find line which cross frame by line(a,b,c) */
void FindLineForEpiline( CvSize imageSize, static void FindLineForEpiline( CvSize imageSize,
float a,float b,float c, float a,float b,float c,
CvPoint2D32f *start,CvPoint2D32f *end, CvPoint2D32f *start,CvPoint2D32f *end,
int*) int*)
@ -2260,8 +2260,7 @@ void FindLineForEpiline( CvSize imageSize,
/*----------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------*/
static int GetAngleLinee( CvPoint2D32f epipole, CvSize imageSize,CvPoint2D32f point1,CvPoint2D32f point2)
int GetAngleLinee( CvPoint2D32f epipole, CvSize imageSize,CvPoint2D32f point1,CvPoint2D32f point2)
{ {
float width = (float)(imageSize.width); float width = (float)(imageSize.width);
float height = (float)(imageSize.height); float height = (float)(imageSize.height);
@ -2352,7 +2351,7 @@ int GetAngleLinee( CvPoint2D32f epipole, CvSize imageSize,CvPoint2D32f point1,Cv
} }
/*--------------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------------*/
void icvComputePerspectiveCoeffs(const CvPoint2D32f srcQuad[4],const CvPoint2D32f dstQuad[4],double coeffs[3][3]) static void icvComputePerspectiveCoeffs(const CvPoint2D32f srcQuad[4],const CvPoint2D32f dstQuad[4],double coeffs[3][3])
{/* Computes perspective coeffs for transformation from src to dst quad */ {/* Computes perspective coeffs for transformation from src to dst quad */
@ -2435,6 +2434,7 @@ void icvComputePerspectiveCoeffs(const CvPoint2D32f srcQuad[4],const CvPoint2D32
return; return;
} }
#endif
/*--------------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------------*/
@ -2690,7 +2690,7 @@ void icvComputeeInfiniteProject2( CvMatr64d rotMatr,
/* Select best R and t for given cameras, points, ... */ /* Select best R and t for given cameras, points, ... */
/* For both cameras */ /* For both cameras */
int icvSelectBestRt( int numImages, static int icvSelectBestRt( int numImages,
int* numPoints, int* numPoints,
CvPoint2D32f* imagePoints1, CvPoint2D32f* imagePoints1,
CvPoint2D32f* imagePoints2, CvPoint2D32f* imagePoints2,
@ -3233,8 +3233,9 @@ int icvStereoCalibration( int numImages,
return CV_NO_ERR; return CV_NO_ERR;
} }
#if 0
/* Find line from epipole */ /* Find line from epipole */
void FindLine(CvPoint2D32f epipole,CvSize imageSize,CvPoint2D32f point,CvPoint2D32f *start,CvPoint2D32f *end) static void FindLine(CvPoint2D32f epipole,CvSize imageSize,CvPoint2D32f point,CvPoint2D32f *start,CvPoint2D32f *end)
{ {
CvPoint2D32f frameBeg; CvPoint2D32f frameBeg;
CvPoint2D32f frameEnd; CvPoint2D32f frameEnd;
@ -3315,9 +3316,8 @@ void FindLine(CvPoint2D32f epipole,CvSize imageSize,CvPoint2D32f point,CvPoint2D
return; return;
} }
/* Find line which cross frame by line(a,b,c) */ /* Find line which cross frame by line(a,b,c) */
void FindLineForEpiline(CvSize imageSize,float a,float b,float c,CvPoint2D32f *start,CvPoint2D32f *end) static void FindLineForEpiline(CvSize imageSize,float a,float b,float c,CvPoint2D32f *start,CvPoint2D32f *end)
{ {
CvPoint2D32f frameBeg; CvPoint2D32f frameBeg;
CvPoint2D32f frameEnd; CvPoint2D32f frameEnd;
@ -3403,7 +3403,7 @@ void FindLineForEpiline(CvSize imageSize,float a,float b,float c,CvPoint2D32f *s
} }
/* Cross lines */ /* Cross lines */
int GetCrossLines(CvPoint2D32f p1_start,CvPoint2D32f p1_end,CvPoint2D32f p2_start,CvPoint2D32f p2_end,CvPoint2D32f *cross) static int GetCrossLines(CvPoint2D32f p1_start,CvPoint2D32f p1_end,CvPoint2D32f p2_start,CvPoint2D32f p2_end,CvPoint2D32f *cross)
{ {
double ex1,ey1,ex2,ey2; double ex1,ey1,ex2,ey2;
double px1,py1,px2,py2; double px1,py1,px2,py2;
@ -3448,7 +3448,7 @@ int GetCrossLines(CvPoint2D32f p1_start,CvPoint2D32f p1_end,CvPoint2D32f p2_star
cross->y = (float)(-delY / del); cross->y = (float)(-delY / del);
return 1; return 1;
} }
#endif
int icvGetCrossPieceVector(CvPoint2D32f p1_start,CvPoint2D32f p1_end,CvPoint2D32f v2_start,CvPoint2D32f v2_end,CvPoint2D32f *cross) int icvGetCrossPieceVector(CvPoint2D32f p1_start,CvPoint2D32f p1_end,CvPoint2D32f v2_start,CvPoint2D32f v2_end,CvPoint2D32f *cross)
{ {
@ -3531,7 +3531,8 @@ int icvGetCrossLineDirect(CvPoint2D32f p1,CvPoint2D32f p2,float a,float b,float
return 1; return 1;
} }
int cvComputeEpipoles( CvMatr32f camMatr1, CvMatr32f camMatr2, #if 0
static int cvComputeEpipoles( CvMatr32f camMatr1, CvMatr32f camMatr2,
CvMatr32f rotMatr1, CvMatr32f rotMatr2, CvMatr32f rotMatr1, CvMatr32f rotMatr2,
CvVect32f transVect1,CvVect32f transVect2, CvVect32f transVect1,CvVect32f transVect2,
CvVect32f epipole1, CvVect32f epipole1,
@ -3610,7 +3611,7 @@ int cvComputeEpipoles( CvMatr32f camMatr1, CvMatr32f camMatr2,
return CV_NO_ERR; return CV_NO_ERR;
}/* cvComputeEpipoles */ }/* cvComputeEpipoles */
#endif
/* Compute epipoles for fundamental matrix */ /* Compute epipoles for fundamental matrix */
int cvComputeEpipolesFromFundMatrix(CvMatr32f fundMatr, int cvComputeEpipolesFromFundMatrix(CvMatr32f fundMatr,

View File

@ -48,7 +48,7 @@
#include "_kdtree.hpp" #include "_kdtree.hpp"
#include "_featuretree.h" #include "_featuretree.h"
#if _MSC_VER >= 1400 #if defined _MSC_VER && _MSC_VER >= 1400
#pragma warning(disable:4996) // suppress "function call with parameters may be unsafe" in std::copy #pragma warning(disable:4996) // suppress "function call with parameters may be unsafe" in std::copy
#endif #endif

View File

@ -1247,7 +1247,7 @@ int _cvSolveEqu1th(T c1, T c0, T* X);
vertices_number: in, number of vertices in polygon vertices_number: in, number of vertices in polygon
Return : Return :
--------------------------------------------------------------------------*/ --------------------------------------------------------------------------*/
void _cvSetSeqBlockSize(CvVoronoiDiagramInt* pVoronoiDiagramInt,int vertices_number) static void _cvSetSeqBlockSize(CvVoronoiDiagramInt* pVoronoiDiagramInt,int vertices_number)
{ {
int N = 2*vertices_number; int N = 2*vertices_number;
cvSetSeqBlockSize(pVoronoiDiagramInt->SiteSeq,N*pVoronoiDiagramInt->SiteSeq->elem_size); cvSetSeqBlockSize(pVoronoiDiagramInt->SiteSeq,N*pVoronoiDiagramInt->SiteSeq->elem_size);

View File

@ -50,6 +50,7 @@
typedef void (*pointer_LMJac)( const CvMat* src, CvMat* dst ); typedef void (*pointer_LMJac)( const CvMat* src, CvMat* dst );
typedef void (*pointer_LMFunc)( const CvMat* src, CvMat* dst ); typedef void (*pointer_LMFunc)( const CvMat* src, CvMat* dst );
#if 0
/* Optimization using Levenberg-Marquardt */ /* Optimization using Levenberg-Marquardt */
void cvLevenbergMarquardtOptimization(pointer_LMJac JacobianFunction, void cvLevenbergMarquardtOptimization(pointer_LMJac JacobianFunction,
pointer_LMFunc function, pointer_LMFunc function,
@ -244,6 +245,7 @@ void cvLevenbergMarquardtOptimization(pointer_LMJac JacobianFunction,
return; return;
} }
#endif
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
#if 0 #if 0

View File

@ -65,9 +65,13 @@ void icvReconstructPoints4DStatus(CvMat** projPoints, CvMat **projMatrs, CvMat**
*/ */
#define TRACK_BUNDLE_FILE "d:\\test\\bundle.txt" #define TRACK_BUNDLE_FILE "d:\\test\\bundle.txt"
void cvOptimizeLevenbergMarquardtBundle( CvMat** projMatrs, CvMat** observProjPoints,
CvMat** pointsPres, int numImages,
CvMat** resultProjMatrs, CvMat* resultPoints4D,int maxIter,double epsilon );
/* ============== Bundle adjustment optimization ================= */ /* ============== Bundle adjustment optimization ================= */
void icvComputeDerivateProj(CvMat *points4D,CvMat *projMatr, CvMat *status, CvMat *derivProj) static void icvComputeDerivateProj(CvMat *points4D,CvMat *projMatr, CvMat *status, CvMat *derivProj)
{ {
/* Compute derivate for given projection matrix points and status of points */ /* Compute derivate for given projection matrix points and status of points */
@ -201,7 +205,7 @@ void icvComputeDerivateProj(CvMat *points4D,CvMat *projMatr, CvMat *status, CvMa
} }
/*======================================================================================*/ /*======================================================================================*/
void icvComputeDerivateProjAll(CvMat *points4D, CvMat **projMatrs, CvMat **pointPres, int numImages,CvMat **projDerives) static void icvComputeDerivateProjAll(CvMat *points4D, CvMat **projMatrs, CvMat **pointPres, int numImages,CvMat **projDerives)
{ {
CV_FUNCNAME( "icvComputeDerivateProjAll" ); CV_FUNCNAME( "icvComputeDerivateProjAll" );
__BEGIN__; __BEGIN__;
@ -228,7 +232,7 @@ void icvComputeDerivateProjAll(CvMat *points4D, CvMat **projMatrs, CvMat **point
} }
/*======================================================================================*/ /*======================================================================================*/
void icvComputeDerivatePoints(CvMat *points4D,CvMat *projMatr, CvMat *presPoints, CvMat *derivPoint) static void icvComputeDerivatePoints(CvMat *points4D,CvMat *projMatr, CvMat *presPoints, CvMat *derivPoint)
{ {
CV_FUNCNAME( "icvComputeDerivatePoints" ); CV_FUNCNAME( "icvComputeDerivatePoints" );
@ -337,8 +341,9 @@ void icvComputeDerivatePoints(CvMat *points4D,CvMat *projMatr, CvMat *presPoints
__END__; __END__;
return; return;
} }
/*======================================================================================*/ /*======================================================================================*/
void icvComputeDerivatePointsAll(CvMat *points4D, CvMat **projMatrs, CvMat **pointPres, int numImages,CvMat **pointDerives) static void icvComputeDerivatePointsAll(CvMat *points4D, CvMat **projMatrs, CvMat **pointPres, int numImages,CvMat **pointDerives)
{ {
CV_FUNCNAME( "icvComputeDerivatePointsAll" ); CV_FUNCNAME( "icvComputeDerivatePointsAll" );
__BEGIN__; __BEGIN__;
@ -364,7 +369,7 @@ void icvComputeDerivatePointsAll(CvMat *points4D, CvMat **projMatrs, CvMat **poi
return; return;
} }
/*======================================================================================*/ /*======================================================================================*/
void icvComputeMatrixVAll(int numImages,CvMat **pointDeriv,CvMat **presPoints, CvMat **matrV) static void icvComputeMatrixVAll(int numImages,CvMat **pointDeriv,CvMat **presPoints, CvMat **matrV)
{ {
int *shifts = 0; int *shifts = 0;
@ -433,7 +438,7 @@ void icvComputeMatrixVAll(int numImages,CvMat **pointDeriv,CvMat **presPoints, C
return; return;
} }
/*======================================================================================*/ /*======================================================================================*/
void icvComputeMatrixUAll(int numImages,CvMat **projDeriv,CvMat** matrU) static void icvComputeMatrixUAll(int numImages,CvMat **projDeriv,CvMat** matrU)
{ {
CV_FUNCNAME( "icvComputeMatrixVAll" ); CV_FUNCNAME( "icvComputeMatrixVAll" );
__BEGIN__; __BEGIN__;
@ -460,7 +465,7 @@ void icvComputeMatrixUAll(int numImages,CvMat **projDeriv,CvMat** matrU)
return; return;
} }
/*======================================================================================*/ /*======================================================================================*/
void icvComputeMatrixW(int numImages, CvMat **projDeriv, CvMat **pointDeriv, CvMat **presPoints, CvMat *matrW) static void icvComputeMatrixW(int numImages, CvMat **projDeriv, CvMat **pointDeriv, CvMat **presPoints, CvMat *matrW)
{ {
CV_FUNCNAME( "icvComputeMatrixW" ); CV_FUNCNAME( "icvComputeMatrixW" );
__BEGIN__; __BEGIN__;
@ -560,9 +565,10 @@ void icvComputeMatrixW(int numImages, CvMat **projDeriv, CvMat **pointDeriv, CvM
__END__; __END__;
return; return;
} }
/*======================================================================================*/ /*======================================================================================*/
/* Compute jacobian mult projection matrices error */ /* Compute jacobian mult projection matrices error */
void icvComputeJacErrorProj(int numImages,CvMat **projDeriv,CvMat **projErrors,CvMat *jacProjErr ) static void icvComputeJacErrorProj(int numImages,CvMat **projDeriv,CvMat **projErrors,CvMat *jacProjErr )
{ {
CV_FUNCNAME( "icvComputeJacErrorProj" ); CV_FUNCNAME( "icvComputeJacErrorProj" );
__BEGIN__; __BEGIN__;
@ -627,9 +633,10 @@ void icvComputeJacErrorProj(int numImages,CvMat **projDeriv,CvMat **projErrors,C
__END__; __END__;
return; return;
} }
/*======================================================================================*/ /*======================================================================================*/
/* Compute jacobian mult points error */ /* Compute jacobian mult points error */
void icvComputeJacErrorPoint(int numImages,CvMat **pointDeriv,CvMat **projErrors, CvMat **presPoints,CvMat *jacPointErr ) static void icvComputeJacErrorPoint(int numImages,CvMat **pointDeriv,CvMat **projErrors, CvMat **presPoints,CvMat *jacPointErr )
{ {
int *shifts = 0; int *shifts = 0;
@ -734,6 +741,7 @@ void icvComputeJacErrorPoint(int numImages,CvMat **pointDeriv,CvMat **projErrors
} }
/*======================================================================================*/ /*======================================================================================*/
/* Reconstruct 4D points using status */ /* Reconstruct 4D points using status */
void icvReconstructPoints4DStatus(CvMat** projPoints, CvMat **projMatrs, CvMat** presPoints, void icvReconstructPoints4DStatus(CvMat** projPoints, CvMat **projMatrs, CvMat** presPoints,
CvMat *points4D,int numImages,CvMat **projError) CvMat *points4D,int numImages,CvMat **projError)
@ -897,7 +905,7 @@ void icvReconstructPoints4DStatus(CvMat** projPoints, CvMat **projMatrs, CvMat**
/*======================================================================================*/ /*======================================================================================*/
void icvProjPointsStatusFunc( int numImages, CvMat *points4D, CvMat **projMatrs, CvMat **pointsPres, CvMat **projPoints) static void icvProjPointsStatusFunc( int numImages, CvMat *points4D, CvMat **projMatrs, CvMat **pointsPres, CvMat **projPoints)
{ {
CV_FUNCNAME( "icvProjPointsStatusFunc" ); CV_FUNCNAME( "icvProjPointsStatusFunc" );
__BEGIN__; __BEGIN__;
@ -998,7 +1006,7 @@ void icvProjPointsStatusFunc( int numImages, CvMat *points4D, CvMat **projMatrs,
} }
/*======================================================================================*/ /*======================================================================================*/
void icvFreeMatrixArray(CvMat ***matrArray,int numMatr) static void icvFreeMatrixArray(CvMat ***matrArray,int numMatr)
{ {
/* Free each matrix */ /* Free each matrix */
int currMatr; int currMatr;
@ -1015,7 +1023,7 @@ void icvFreeMatrixArray(CvMat ***matrArray,int numMatr)
} }
/*======================================================================================*/ /*======================================================================================*/
void *icvClearAlloc(int size) static void *icvClearAlloc(int size)
{ {
void *ptr = 0; void *ptr = 0;
@ -1047,6 +1055,7 @@ int icvDeleteSparsInPoints( int numImages,
} }
#endif #endif
/*======================================================================================*/ /*======================================================================================*/
/* !!! may be useful to return norm of error */ /* !!! may be useful to return norm of error */
/* !!! may be does not work correct with not all visible 4D points */ /* !!! may be does not work correct with not all visible 4D points */

View File

@ -46,6 +46,8 @@
/* Valery Mosyagin */ /* Valery Mosyagin */
#if 0
typedef void (*pointer_LMJac)( const CvMat* src, CvMat* dst ); typedef void (*pointer_LMJac)( const CvMat* src, CvMat* dst );
typedef void (*pointer_LMFunc)( const CvMat* src, CvMat* dst ); typedef void (*pointer_LMFunc)( const CvMat* src, CvMat* dst );
@ -61,7 +63,7 @@ void icvReconstructPointsFor3View( CvMat* projMatr1,CvMat* projMatr2,CvMat* proj
/* Jacobian computation for trifocal case */ /* Jacobian computation for trifocal case */
void icvJacobianFunction_ProjTrifocal(const CvMat *vectX,CvMat *Jacobian) static void icvJacobianFunction_ProjTrifocal(const CvMat *vectX,CvMat *Jacobian)
{ {
CV_FUNCNAME( "icvJacobianFunction_ProjTrifocal" ); CV_FUNCNAME( "icvJacobianFunction_ProjTrifocal" );
__BEGIN__; __BEGIN__;
@ -161,7 +163,7 @@ void icvJacobianFunction_ProjTrifocal(const CvMat *vectX,CvMat *Jacobian)
return; return;
} }
void icvFunc_ProjTrifocal(const CvMat *vectX, CvMat *resFunc) static void icvFunc_ProjTrifocal(const CvMat *vectX, CvMat *resFunc)
{ {
/* Computes function in a given point */ /* Computes function in a given point */
/* Computers project points using 3 projection matrices and points 3D */ /* Computers project points using 3 projection matrices and points 3D */
@ -264,7 +266,7 @@ void icvFunc_ProjTrifocal(const CvMat *vectX, CvMat *resFunc)
/*----------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------*/
void icvOptimizeProjectionTrifocal(CvMat **projMatrs,CvMat **projPoints, static void icvOptimizeProjectionTrifocal(CvMat **projMatrs,CvMat **projPoints,
CvMat **resultProjMatrs, CvMat *resultPoints4D) CvMat **resultProjMatrs, CvMat *resultPoints4D)
{ {
@ -441,7 +443,7 @@ void icvOptimizeProjectionTrifocal(CvMat **projMatrs,CvMat **projPoints,
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
/* Create good points using status information */ /* Create good points using status information */
void icvCreateGoodPoints(CvMat *points,CvMat **goodPoints, CvMat *status) static void icvCreateGoodPoints(CvMat *points,CvMat **goodPoints, CvMat *status)
{ {
*goodPoints = 0; *goodPoints = 0;
@ -493,3 +495,4 @@ void icvCreateGoodPoints(CvMat *points,CvMat **goodPoints, CvMat *status)
return; return;
} }
#endif

View File

@ -96,15 +96,15 @@ double _cvStretchingWork(CvPoint2D32f* P1,
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
CvPoint2D32f Q( CvPoint2D32f q0, CvPoint2D32f q1, CvPoint2D32f q2, double t );
double angle( CvPoint2D32f A, CvPoint2D32f B );
double _cvBendingWork( CvPoint2D32f* B0, double _cvBendingWork( CvPoint2D32f* B0,
CvPoint2D32f* F0, CvPoint2D32f* F0,
CvPoint2D32f* B1, CvPoint2D32f* B1,
CvPoint2D32f* F1/*, CvPoint2D32f* F1/*,
CvPoint* K*/) CvPoint* K*/)
{ {
CvPoint2D32f Q( CvPoint2D32f q0, CvPoint2D32f q1, CvPoint2D32f q2, double t );
double angle( CvPoint2D32f A, CvPoint2D32f B );
CvPoint2D32f Q0, Q1, Q2; CvPoint2D32f Q0, Q1, Q2;
CvPoint2D32f Q1_nm = { 0, 0 }, Q2_nm = { 0, 0 }; CvPoint2D32f Q1_nm = { 0, 0 }, Q2_nm = { 0, 0 };
double d0, d1, d2, des, t_zero; double d0, d1, d2, des, t_zero;
@ -511,6 +511,7 @@ void _cvWorkSouth(int i, int j, _CvWork** W, CvPoint2D32f* edges1, CvPoint2D32f*
} }
} }
//=================================================== //===================================================
CvPoint2D32f Q(CvPoint2D32f q0,CvPoint2D32f q1,CvPoint2D32f q2,double t) CvPoint2D32f Q(CvPoint2D32f q0,CvPoint2D32f q1,CvPoint2D32f q2,double t)
{ {
@ -526,7 +527,7 @@ double angle(CvPoint2D32f A, CvPoint2D32f B)
{ {
return acos( (A.x*B.x + A.y*B.y)/sqrt( (double)(A.x*A.x + A.y*A.y)*(B.x*B.x + B.y*B.y) ) ); return acos( (A.x*B.x + A.y*B.y)/sqrt( (double)(A.x*A.x + A.y*A.y)*(B.x*B.x + B.y*B.y) ) );
} }
#if 0
/***************************************************************************************\ /***************************************************************************************\
* *
* This function compute intermediate polygon between contour1 and contour2 * This function compute intermediate polygon between contour1 and contour2
@ -536,7 +537,7 @@ double angle(CvPoint2D32f A, CvPoint2D32f B)
* param = [0,1]; 0 correspondence to contour1, 1 - contour2 * param = [0,1]; 0 correspondence to contour1, 1 - contour2
* *
\***************************************************************************************/ \***************************************************************************************/
CvSeq* icvBlendContours(CvSeq* contour1, static CvSeq* icvBlendContours(CvSeq* contour1,
CvSeq* contour2, CvSeq* contour2,
CvSeq* corr, CvSeq* corr,
double param, double param,
@ -621,7 +622,7 @@ CvSeq* icvBlendContours(CvSeq* contour1,
**************************************************************************************************/ **************************************************************************************************/
void icvCalcContoursCorrespondence(CvSeq* contour1, static void icvCalcContoursCorrespondence(CvSeq* contour1,
CvSeq* contour2, CvSeq* contour2,
CvSeq** corr, CvSeq** corr,
CvMemStorage* storage) CvMemStorage* storage)
@ -852,4 +853,4 @@ void icvCalcContoursCorrespondence(CvSeq* contour1,
free(edges1); free(edges1);
free(edges2); free(edges2);
} }
#endif

View File

@ -87,12 +87,12 @@ namespace cv{
return cvPoint(rect.x + rect.width/2, rect.y + rect.height/2); return cvPoint(rect.x + rect.width/2, rect.y + rect.height/2);
} }
void homography_transform(IplImage* frontal, IplImage* result, CvMat* homography) // static void homography_transform(IplImage* frontal, IplImage* result, CvMat* homography)
{ // {
cvWarpPerspective(frontal, result, homography); // cvWarpPerspective(frontal, result, homography);
} // }
CvAffinePose perturbate_pose(CvAffinePose pose, float noise) static CvAffinePose perturbate_pose(CvAffinePose pose, float noise)
{ {
// perturbate the matrix // perturbate the matrix
float noise_mult_factor = 1 + (0.5f - float(rand())/RAND_MAX)*noise; float noise_mult_factor = 1 + (0.5f - float(rand())/RAND_MAX)*noise;
@ -107,7 +107,7 @@ namespace cv{
return pose_pert; return pose_pert;
} }
void generate_mean_patch(IplImage* frontal, IplImage* result, CvAffinePose pose, int pose_count, float noise) static void generate_mean_patch(IplImage* frontal, IplImage* result, CvAffinePose pose, int pose_count, float noise)
{ {
IplImage* sum = cvCreateImage(cvSize(result->width, result->height), IPL_DEPTH_32F, 1); IplImage* sum = cvCreateImage(cvSize(result->width, result->height), IPL_DEPTH_32F, 1);
IplImage* workspace = cvCloneImage(result); IplImage* workspace = cvCloneImage(result);
@ -130,14 +130,14 @@ namespace cv{
cvReleaseImage(&workspace_float); cvReleaseImage(&workspace_float);
} }
void generate_mean_patch_fast(IplImage* /*frontal*/, IplImage* /*result*/, CvAffinePose /*pose*/, // static void generate_mean_patch_fast(IplImage* /*frontal*/, IplImage* /*result*/, CvAffinePose /*pose*/,
CvMat* /*pca_hr_avg*/, CvMat* /*pca_hr_eigenvectors*/, const OneWayDescriptor* /*pca_descriptors*/) // CvMat* /*pca_hr_avg*/, CvMat* /*pca_hr_eigenvectors*/, const OneWayDescriptor* /*pca_descriptors*/)
{ // {
/*for(int i = 0; i < pca_hr_eigenvectors->cols; i++) // /*for(int i = 0; i < pca_hr_eigenvectors->cols; i++)
{ // {
}*/ // }*/
} // }
void readPCAFeatures(const char *filename, CvMat** avg, CvMat** eigenvectors, const char *postfix = ""); void readPCAFeatures(const char *filename, CvMat** avg, CvMat** eigenvectors, const char *postfix = "");
void readPCAFeatures(const FileNode &fn, CvMat** avg, CvMat** eigenvectors, const char* postfix = ""); void readPCAFeatures(const FileNode &fn, CvMat** avg, CvMat** eigenvectors, const char* postfix = "");
@ -249,18 +249,18 @@ namespace cv{
m_train_patch = cvCreateImage(GetInputPatchSize(), IPL_DEPTH_8U, 1); m_train_patch = cvCreateImage(GetInputPatchSize(), IPL_DEPTH_8U, 1);
} }
void cvmSet2DPoint(CvMat* matrix, int row, int col, CvPoint2D32f point) // static void cvmSet2DPoint(CvMat* matrix, int row, int col, CvPoint2D32f point)
{ // {
cvmSet(matrix, row, col, point.x); // cvmSet(matrix, row, col, point.x);
cvmSet(matrix, row, col + 1, point.y); // cvmSet(matrix, row, col + 1, point.y);
} // }
void cvmSet3DPoint(CvMat* matrix, int row, int col, CvPoint3D32f point) // static void cvmSet3DPoint(CvMat* matrix, int row, int col, CvPoint3D32f point)
{ // {
cvmSet(matrix, row, col, point.x); // cvmSet(matrix, row, col, point.x);
cvmSet(matrix, row, col + 1, point.y); // cvmSet(matrix, row, col + 1, point.y);
cvmSet(matrix, row, col + 2, point.z); // cvmSet(matrix, row, col + 2, point.z);
} // }
CvAffinePose GenRandomAffinePose() CvAffinePose GenRandomAffinePose()
{ {
@ -1726,7 +1726,7 @@ namespace cv{
cvReleaseMat(&eigenvalues); cvReleaseMat(&eigenvalues);
} }
void extractPatches (IplImage *img, vector<IplImage*>& patches, CvSize patch_size) static void extractPatches (IplImage *img, vector<IplImage*>& patches, CvSize patch_size)
{ {
vector<KeyPoint> features; vector<KeyPoint> features;
Ptr<FeatureDetector> surf_extractor = FeatureDetector::create("SURF"); Ptr<FeatureDetector> surf_extractor = FeatureDetector::create("SURF");

View File

@ -41,7 +41,7 @@
#ifndef __OPENCV_PRECOMP_H__ #ifndef __OPENCV_PRECOMP_H__
#define __OPENCV_PRECOMP_H__ #define __OPENCV_PRECOMP_H__
#if _MSC_VER >= 1200 #if defined _MSC_VER && _MSC_VER >= 1200
#pragma warning( disable: 4251 4710 4711 4514 4996 ) #pragma warning( disable: 4251 4710 4711 4514 4996 )
#endif #endif

Some files were not shown because too many files have changed in this diff Show More